This is how i set up my view:
# Set layout and views directories
Zend_Layout::startMvc( MODULE_PATH .'/layouts/scripts' );
# Init views object
$this->view = Zend_Layout::getMvcInstance()->getView();
$this->view->doctype( 'XHTML1_STRICT' );
$this->view->setScriptPath( MODULE_PATH . 'views/scripts/' );
$this->viewRenderer = $this->_helper->getHelper('viewRenderer');
$this->viewRenderer->setView($this->view)->setViewBasePathSpec(
MODULE_PATH . 'views/scripts/'
)->setViewScriptPathSpec(':controller/:action.phtml');
On Fri, May 29, 2009 at 12:50 PM, monk.e.boy <[email protected]>wrote:
>
>
>
> vince. wrote:
> >
> >
> > $view = new Zend_View();
> > $view->addScriptPath('/path/to/app/views');
> > $view->addScriptPath('/path/to/custom/');
> >
> > P.S BTW i personally use the viewRenderer helper, Makes things easier to
> > render.
> >
> >
>
> Thanks for the hint. I added this:
>
> $this->view->addScriptPath('/var/www/ZF-apps/');
>
> in my controller init() method.
>
> I never use:
>
> $view = new Zend_View();
>
> in any of my code, in each controller there is a magic $this->view which is
> always there. I'm not sure where it comes from ;)
>
> >> P.S BTW i personally use the viewRenderer helper, Makes things easier to
> render.
>
> What did you mean? Could you explain this a little more? :)
>
> monk.e.boy
> --
> View this message in context:
> http://www.nabble.com/ZF-1.8.2-no-more-..-..-..--in-my-views%21-tp23764251p23777159.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>
--
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/