I have a sidebar which appears on every page. The first elements of the sidebar are either a) a login form, or b) details of the current user, (depending on whether the user is logged in or not).
I have read up on a few ways to accomplish this and am planning to initialise a sidebar placeholder in the bootstrap.
When it comes to appending the user details, or the login form, to the sidebar, should I be doing this from predispatch in an Action Helper? Or from predispatch in a controller plugin? Why?
Thanks!
I recommend reading Using Action Helpers To Implement Re-Usable Widgets by Matthew Weier O’Phinney (ZF Lead).
In his example he uses
public function preDispatch()in an Action Helper to create a reusable Login/User-Widget.