|
|||
|
I've seen few tutorials on this, but they all seem to take rather strange approach and sometimes not very compatible with Zend View system. I wanted to share my 2 classes I created for this. Hope someone will find these usefule:
PHP Code:
PHP Code:
Then you derive your controllers from Ant_Controller_Action and use it as normal. |
|
|||
|
Can you write instruction step by step how use it?
I have tried run this, but something is wrong and I don't know what. I have created files ant/SmartyView.php (with first code) and I wrote right after Zend_Controller_Action class yours Ant_Controller_Action (second code). I have changed controller and now it extends Ant_Controller_Action. But how use it now I have a little view in Zend and I don't have idea how it should works... can you give some example code... regards |
|
||||
|
That's actually a very strange way of doing it... I don't think that is compatible with ViewRenderer at all. You shouldn't have to edit the Zend_Controller_Action class to include a view and that does make things slightly harder to change around
__________________
SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home SpotSec Blog: http://spotsec.com/blog |
|
|||
|
make sure view smarty is set up properly. and then your controller classes extend from Ant_Controller_Action.
Ant_View_Smarty class simply sets up the smarty template engine and interfaces it with Zend. Ant_Controller_Action is same as Zend_Controller_Action, but uses our Smarty view. The reason I did so was to have Zend_View like integration with smarty and the controller code would ber as much as possible similar to "real" code. Also from smarty templates to access ZF functionality (helpers, filters) use {$view->xxx} To get around viewRenderer I did this in my bootstrap file: PHP Code:
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|