bootstrapping - Zend Framework: How to pass data from bootstrap to layout? -


i have configuration values set in application.ini , want pass values layout on application load. how can bootstrap ? trial tried doing this

in bootstrap initialization function:

$this->bootstrap('view'); $view = $this->getresource('view'); $view->layout()->whatever = "some value"; 

in layout:

<?php echo $this->layout()->whatever; ?> 

but m not able value display in layout.

the following should work:

$this->bootstrap('view'); $view = $this->getresource('view'); $view->whatever = 'some value'; 

then, in layout:

<?php echo $this->whatever ?> 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -