$this->getLayer('foo')->getSlot('bar')->setActionName('Baz');- David On 05.03.2009, at 23:22, Michal wrote:
I have seen at http://www.agavi.org/documentation/tutorial/layers.html Layouts can be composed in PHP code during run time To achieve what I want, I think I would like to have is have a decorator layer, with some fixed slots for the sidebar actions. I know how to do this if the slot actions are the same for all pages on the site (just like the sample app menu slot). However, I would like to choose which actions these slots call within the view of the action called by the matched route. Is this possible? Michal.On Wed, Mar 4, 2009 at 2:36 PM, Michal <[email protected]> wrote:Hi, I would like to have a 'sidebar' that calls 'secondary' actions. Sometimes only one action in the sidebar, sometimes several. Which actions are called will be dependent on the currently matched route. They will either be lists of static links to external sites, ordynamically generated internal links (most recently added data to somesome models): so I think at least two different actions will be required. I know I can have a fixed slot in a layout that calls an action: say just like the menu action in the sample app. As far as I can tell, this slot behaves independently of the matched route. As I found out at http://groups.google.com/group/agavi-users/browse_thread/thread/73240737fe19812d , this can be easily changed using: $request->getAttribute('matched_routes', 'org.agavi.routing'); for example, to choose which menu item to add a class 'currrent' to. For the sidebars, I could have a fixed 'sidebar' action called in thelayout. I think I could, in the view for the 'sidebar' action, use the 'matched_routes' parameter to choose between actions to put into 'sub'slots. This would be by some switch / if block. I guess the sidebar could be termed a proxy action. However, this seems a bit more of arouting/layout issue than something that should go in a view. Is thereanother, better, way of achieving this? Or is there in fact nothing wrong with this approach? Michal._______________________________________________ users mailing list [email protected] http://lists.agavi.org/mailman/listinfo/users
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ users mailing list [email protected] http://lists.agavi.org/mailman/listinfo/users
