>
> Hi Alexander,
>
> I tried your solution (had checked out actionStack before) and it
> kinda works, the only open problem:
>
> $this->_helper->viewRenderer->setResponseSegment('auth') has to be
> called in every action of my authController to be rendered in the
> layout()->nav section of my layout template.
> This also means that the action output can never be rendered in
> content again, not even when I want to display it there by directly
> calling the controller/action combination.
>
If you prefer to set 'nav' section as a default output segment for whole
controller you might place this code into the init() method and redefine it
in particular actions to 'content' again according to request params or
other conditions. Anyway (imho) controllers are best for such things.
Murphy-8 wrote:
>
> And calling the action directly results in it being displayed twice in
> layout()->nav and with empty layout()->content.
>
No. content segment will be empty but you can detect direct call and change
things whatever you want. Even to change the layout ;)
Murphy-8 wrote:
>
> Having it displayed only once could be a solution I could go with,
> since I will have to figure out a session-based solution for that
> anyway:
> Imagine you enter the site, got to /news/list and then decide to login
> to the site via the auth widget thats displayed in the sidebar.
> You click login and the widget changes to the login box (either after
> a reload, or fetched through ajax) but the layout()->content stays at /
> news/list.
>
since you have an authAction in actionStack in any request, only thing you
have to change is "action" attibute of the Login form - it must submit auth
data to the current URL (news/list) but extracted from request only in
authAction. BTW, I've never faced such problem, so it's just a concept ;)
-----
--
Alexander Anokhim
AVTOVAZ JSC
--
View this message in context: http://www.nabble.com/Widgetized-content-with-Zend_Layout-tp22112654p22119984.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论