|
|||
|
Hi everyone,
I'm reading a lot about Zend_Layout, but I can't figure out how to access the same data into more than one view. For example : layout.phtml Code:
<?php echo $this->layout()->nav; echo $this->layout()->content; Code:
<p>hello <?=$this->user['username'];?></p> Code:
<img src="<?=$this->user['avatar'];?>" alt="" /> I could : - "init" the controller for the user, and then register the data into some property of the controller - use cache - use registry - merge the views when they use the same data But any of those seem accurate for that problem. Thank you for your help elvex |
|
|||
|
... or maybe placeholders are meant to do that ?
But what's confusing me is that I don't need to share some html result, but only some objects / data to access at multiple places. And I still don't know how to create a placeholder shared by multiple actions. Last edited by elvex : 07-06-2008 at 11:32 PM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|