开发者

Multiple layouts in zend framework

In my site I want two layouts.

  1. Main layout comes when no login.
  2. Whenever a user logs in there will be 1 more layou开发者_高级运维t inside 1st with menu for account changes etc.

Can anyone explain how can we do it.?


If you just want to change the navigation for logged in/not logged in users, look into role privileges in zend_navigation_page

http://framework.zend.com/manual/en/zend.navigation.pages.html


Several options.

One is to use a pre-dispatch front controller plugin. Simply check Zend_Auth to see if user is logged in. If so, then set the layout to the 'logged-in' layout, else leave as default layout.

Another option is to check Zend_Auth from inside your actual layout file, and only include the additional code/formatting if they are logged in.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜