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 <[email protected]>
> wrote:
> 
>> Hey,
>>
>> Or you could simply overload it.
>>
>> $layout->sidebar = "something here";
>>
>> Vince.
>>
>>
>> On Mon, Apr 13, 2009 at 1:31 PM, lightflowmark
>> <[email protected]
>> > 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.

Reply via email to