I am facing a problem in zend-framework
related to layout
. Here I have to pass some values
to the layout
that will be used to display the top-ranking users
of the site.
Since I am new to zend-framework, I'm not able to find any way to do so.
If you have any code, idea or link, please provide me.....
Thanks in advance...........
Create a Controller Plugin that fetches this data anytime before the layout is rendered and pass the data to to the view. Then render that data on your layout.phtml like you would render any other data, e.g. use a ViewHelper or a Partial.
See http://zendframework.com/manual/en/zend.controller.plugins.html
Or use an Action Helper as explained at
The layout in Zend Framework is just an other view. We could define the layout as the "outer view" and the view associated with a controller action as the "inner view". To send data to the layout from a controller you can simply like this
From the controller
$this->view->someData = $data
From the layout
$this->someData
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With