All of this code would belong in an _init method of the Bootstrap.php, like so:

public function _initView()
{
    // code to setup the view here
}

Normally the view gets setup with a View resource class. Take a look
at Zend_Application_Resource_View to see what your _initView() method
would be replacing. Make sure the _initView() method returns your
instance of Naneau_View_Smarty so that this object is considered the
"view resource".

For more info on resource bootstrapping, take a look at:
http://framework.zend.com/manual/en/zend.application.theory-of-operation.html

Additionally, the code for adding the module directory to the front
controller can be done in your application.ini config file:

resources.frontController.moduleDirectory = APPLICATION_PATH

Konr

On Sat, Sep 24, 2011 at 9:48 AM, robert mena <[email protected]> wrote:
> Hi,
>
> I am using smarty with my ZF projects but using the old (pre-zf.sh
> tool) structure.  In my index.php I have the following code
>
> $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
> $viewRenderer->setView(new Naneau_View_Smarty(
>                            array('compileDir' => $smarty['compile_dir'])
>                            )
>                        );
> $viewRenderer->setViewSuffix('tpl');
>
> Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
>
> $front = Zend_Controller_Front::getInstance();
> $front->addModuleDirectory('../application/');
> $front->dispatch();
>
> What would be the correct way to do it in the new index.php (or the
> Bootstrap.php?) generated by the zf.sh?
>
> Regards.
>
> --
> List: [email protected]
> Info: http://framework.zend.com/archives
> Unsubscribe: [email protected]
>
>
>

--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to