Thursday, August 30, 2007

Zend Framework and Smarty Integration Tips

Just got Zend Framework 1.0.1 and Smarty to work together!!!


ain't that easy...


here's what i did:







    here's the code in my bootstrap:

    // Different view implementation
    //$view = new ZF_Smarty();
    $smarty_config = array(
    'compile_dir' => './smarty/templates_c/',
    'config_dir' => './smarty/configs/',
    'cache_dir' => './smarty/cache/',
    'debugging' => true,
    );
    $view = new Zend_View_Smarty('./application/views/scripts/', $smarty_config);

    $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
    $viewRenderer->setViewBasePathSpec('./application/views/scripts/')
    ->setViewScriptPathSpec(':controller'.DIRECTORY_SEPARATOR.':action.:suffix')
    ->setViewScriptPathNoControllerSpec(':action.:suffix')
    ->setViewSuffix('tpl');
    Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);




About Me

I'm a web dude and this is my geek blog. There should be lots of content ... if I'm working hard ...