2008年11月10日星期一

Re: [fw-mvc] Different layout in a modular application

Antonio Caccese wrote:
>
> Hi. I am newbie to Zend Framework and i have a question about the layout
> management. In my application i have 3 modules accordingly the following
> directory structure.
>
> /application
> /modules
> /admin
> /controllers
> /layouts
> /views
> /default
> /controllers
> /layouts
> /views
> /photogallery
> /controllers
> /views
>
> I use a LayoutPlugin class to switch between the default and the admin
> layouts accordingly the module name stored in the request object.
>
> In the photogallery module there are different Controllers. Consider for
> example the CategoryController, a controller to manage the categories of
> the photogallery. In this controller there are the following actions:
> index, view, add, edit and delete. Now, when i am in the admin module and
> i want to add a category, i use this url
> http://mysite/photogallery/category/add but the application switch,
> obviously to the default layout while i want to remain in the admin
> layout.
>
> What's the best strategy to fix it?
>
> Hello from Italy.
>

I would put that action in a controller in the admin module since its
administrative stuff. If you don't want to do that, simply modify your
plugin so that it uses the admin layout while on that action.
--
View this message in context: http://www.nabble.com/Different-layout-in-a-modular-application-tp20430867p20431099.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: