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
Post a Comment