Hey,

Both the constructor and the startMvc() static method can accept either an
array of options or a Zend_Config object with options in order to configure
the Zend_Layout instance.

Example:

$options = array( 'layout' => 'foo', 'layoutPath' => '/path/to/layouts' );
$view = Zend_Layout::startMvc($options)->getView();

You should read the manual.

Vince.

On Wed, May 6, 2009 at 11:04 AM, iceangel89 <comet2...@gmail.com> wrote:

>
> how do i get view from the bootstrap file/class?
>
> $view = Zend_Layout::startMvc()->getView();
>
> gives
>
> Fatal error: Uncaught exception 'Zend_Layout_Exception' with message
> 'setOptions() expects either an array or a Zend_Config object' in
> D:\JiewMeng\ZendFramework\library\Zend\Layout.php:234 Stack trace: #0
> D:\JiewMeng\ZendFramework\library\Zend\Layout.php(180):
> Zend_Layout->setOptions(NULL) #1
> D:\JiewMeng\sites\zf-ims\application\modules\lab\Bootstrap.php(5):
> Zend_Layout::startMvc() #2
>
> D:\JiewMeng\ZendFramework\library\Zend\Application\Bootstrap\BootstrapAbstract.php(580):
> Lab_Bootstrap->_initApp() #3
>
> D:\JiewMeng\ZendFramework\library\Zend\Application\Bootstrap\BootstrapAbstract.php(533):
> Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('app') #4
>
> D:\JiewMeng\ZendFramework\library\Zend\Application\Bootstrap\BootstrapAbstract.php(497):
> Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap(NULL) #5
>
> D:\JiewMeng\ZendFramework\library\Zend\Application\Resource\Modules.php(84):
> Zend_Application_Bootstrap_BootstrapAbstract->bootstrap() #6
>
> D:\JiewMeng\ZendFramework\library\Zend\Application\Bootstrap\BootstrapAbstra
> in D:\JiewMeng\ZendFramework\library\Zend\Layout.php on line 234
> --
> View this message in context:
> http://www.nabble.com/Getting-view-from-Bootstrap-%28ZF1.8%29-tp23401867p23401867.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/

Reply via email to