View Single Post
  #4 (permalink)  
Old 07-17-2007, 03:57 PM
albeva albeva is offline
Junior Member
 
Join Date: May 2007
Posts: 22
Default

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:
        $viewRenderer Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
        
$view = new Ant_View_Smarty();
        
$viewRenderer->setView($view)
                     ->
setViewSuffix('tpl'); 
this is tested and works fine with ZF 1.0 final.
Reply With Quote