Try this. It worked for me.

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected $_pluginResources = array('view' => array()); // or remove
this and add 'resources.view = on' in application.ini

    protected function _initNavigation()
    {
        $this->bootstrap('view');
        $view = $this->getResource('view');
        $nav = new Zend_Navigation(array(array('label' =>'foo', 'uri'
=>'/foo/bar')));
        $view->navigation($nav);
    }

}


   -- Mon


On Wed, May 6, 2009 at 9:48 PM, iceangel89 <[email protected]> wrote:

>
> hmm ... does not seem to work ...
>
> $view = $this->getResource('view');
>
> echo $view;die(); prints nothing
>
> and then $view->navigate($nav);
>
> gives Call to a member function navigate() on a non-object probably $view
> is
> null
>
>
> Mon Zafra wrote:
> >
> > On Wed, May 6, 2009 at 8:22 PM, iceangel89 <[email protected]> wrote:
> >
> >>
> >> just wondering... if i do that it will be v long. so anyway to have
> >> application.ini read another file that has config for just navigation?
> >>
> >>
> > I don't think so. Anyway, I think you can do this:
> >
> >     protected function _initView()
> >     {
> >         $view = new Zend_View();
> >
> >
> Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setView($view);
> >         return $view;
> >     }
> >
> >     protected function _initNavigation()
> >     {
> >         $view = $this->getResource('view');
> >         $nav = ...;
> >         $view->navigation($nav);
> >     }
> >
> >    -- Mon
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Getting-view-from-Bootstrap-%28ZF1.8%29-tp23401867p23407061.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>

Reply via email to