That was great. Thanks for the article. So, as usual, I took one step forward and two steps back. I thought I had figured it out by making a sidebar controller, navigation controller etc, but it seems I was mislead by the all the evil FSUC authors. But it is a lot of fun.
So with that being said, I am back to square one. How do I place echo $this->sidebar into my layout script and have it called without using controllers. How does the framework know what to do when the view sees echo $this->sidebar without any other hints? Is this where a view partial comes into play? Do I need a view helper to take care of tying all the elements of the sidebar together and assigning meaning to $this->sidebar? Thanks a lot. On Tue, Apr 14, 2009 at 7:13 AM, swilhelm <st...@studio831.com> wrote: > > You may wish to read this very interesting > > http://blog.astrumfutura.com/archives/373-The-M-in-MVC-Why-Models-are-Misunderstood-and-Unappreciated.html > article by Padraic Brady on Models and their role in the MVC pattern. > > I think the section entitled, "Models are Classes, Controllers are > Processes," is germane to the design of a sidebar. You might consider > implementing your sidebar as a Model or set of Models that are rendered > using View Partials, possibly one Model / View Partial pair per sidebar > feature (e.g. blogroll, ad unit, etc.). > > - Steve W. > > > Jason DeBord wrote: > > > > Thanks for the replies. > > > > I created a SidebarController with a sidebarAction() function. In > > sidebar.phtml I have coded the template for my sidebar. Next, I > registered > > this with the actionstack like this: > > > > $this->_helper->actionStack('nav', 'nav','default'); > > $this->_helper->actionStack('sidebar', 'sidebar','default'); > > > > This is not a good solution however, because I would have to use the > > actionstack in all of my contollers. I want to control what is in the > > sidebar from the SidebarController. > > > > I think I can code a Front Controller Plugin??? That will take care of > > this > > for me... Maybe? > > > > I'm struggling with this step though. Any advice? > > > > Cheers, > > > > J > > > > > > On Mon, Apr 13, 2009 at 12:38 PM, Vadim Gabriel <vadim...@gmail.com> > > wrote: > > > >> Hey, > >> > >> Or you could simply overload it. > >> > >> $layout->sidebar = "something here"; > >> > >> Vince. > >> > >> > >> On Mon, Apr 13, 2009 at 1:31 PM, lightflowmark > >> <1...@lightflowinterrupted.com > >> > wrote: > >> > >>> > >>> They are placeholders for content to be later inserted into. > >>> > >>> Typically, I think, you would have actions called e.g. sidebarAction > and > >>> navAction. In each of these you would have a line like > >>> $this->_helper->viewRenderer->setResponseSegment('sidebar'); > >>> > >>> > >>> You would then add these actions to the actionStack, so that on any > >>> request, > >>> these two actions were called in addition to your main action. > >>> > >>> Sorry that's a bit terse, but should help you get started. > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> Jason DeBord wrote: > >>> > > >>> > > >>> > http://framework.zend.com/manual/en/zend.layout.quickstart.html#zend.layout.quickstart.example > >>> > > >>> > In the above link, what are <?= $this->layout()->nav ?> and <?= > >>> > $this->layout()->sidebar ?> > >>> > > >>> > Are they view helpers? Would someone point me to a resource > describing > >>> how > >>> > to build one? For example, a template of a sidebar that would be > >>> called > >>> by > >>> > <?= $this->layout()->sidebar ?> . > >>> > > >>> > Thanks. > >>> > > >>> > > >>> > >>> -- > >>> View this message in context: > >>> > http://www.nabble.com/What-is-this%3A-%3C-%3D-%24this-%3Elayout%28%29-%3Esidebar--%3E-tp23011364p23020557.html > >>> Sent from the Zend Framework mailing list archive at Nabble.com. > >>> > >>> > >> > >> > >> -- > >> Vincent Gabriel. > >> Lead Developer, Senior Support. > >> Zend Certified Engineer. > >> Zend Framework Certified Engineer. > >> > >> > >> > >> > >> > > > > > > -- > View this message in context: > http://www.nabble.com/What-is-this%3A-%3C-%3D-%24this-%3Elayout%28%29-%3Esidebar--%3E-tp23011364p23033371.html > Sent from the Zend Framework mailing list archive at Nabble.com. > >