-- Ibrahim Abdullah <[EMAIL PROTECTED]> wrote
(on Sunday, 09 March 2008, 04:37 AM -0700):
> I'm using the Zend_Controller_Front class to make my bootstrap for my
> application.
> I can't seem to find a method to change the default view/scripts folder with
> Zend_Controller_Front. 
> 
> I do see examples in which I need to create a Zend_View object, but doesn't
> Zend_Controller_Front do that for me ? 
> 
> So I can't make a Zend_View object, because there isn't a method in
> Zend_Controller_Front to set a custom View object (should be, though).
> 
> Does somebody have any idea ?

Zend_Controller_Front is view-agnostic, and actually has no awareness of
the view object whatsoever. Within the Action controllers, we
automatically register the ViewRenderer action helper, which injects a
view object into the action controllers, and takes care of rendering
automatically.

You can customize the view object in your bootstrap pretty easily:

    $viewRenderer = 
Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
    $viewRenderer->initView();
    $viewRenderer->view->addScriptPath(...);

Hope that helps.

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to