-- Apsy <[EMAIL PROTECTED]> wrote
(on Friday, 12 September 2008, 01:04 PM +0200):
> I have a problem with my custom class of Zend_View.
>
> In my bootstrap, i have instanciate a plugin wich initialize the  
> application like the "Pastebin" app of Matthew.
> But i have a problem :
> in my initView method of my plugin :
>
> public function initView()
>    {
>        /*************************
>         * View
>         ************************/
>        $view = new App_View_Page();

<snip: view configuration>

>              /*************************
>         * ViewRenderer
>         ************************/
>        $viewRenderer = new  
> Zend_Controller_Action_Helper_ViewRenderer($view);
>        $viewRenderer
>             ->setViewBasePathSpec(BASE_PATH . '/application/design/views')
>             ->setViewScriptPathSpec(':module/:controller/:action.:suffix')
>             ->setViewSuffix('phtml');
>        Zend_Debug::dump(get_class($viewRenderer->view));
>        $viewRenderer->init();

Here's the problem, right there. init() will initialize a DIFFERENT view
object. What you want to do is add your already initialized view object
to the view renderer:

    $viewRenderer->setView($view);

and then things should work as expected

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to