I'm working on a ZF-based application, and I've a problem... I'm using a layout to define my header/footer and a view printed using
"echo $this->layout()->content".
The problem is that in a controller, each page have the same structure and I want to create a layout for them. I can create a new layout but in its I have to write again my header/footer declarations, and I don't want because if I have to change one link, I will have to change in the both layouts.
So, my question is: is it possible to create a layout name "my_controller" within I'll user "echo $this->layout()->content" and my view will be printed in, and that my new layout takes place of the view in my main "layout" layout?
These files will be used to generate HTML of my pages:
layouts/layout.phtml > layouts/my_controller.phtml > views/my_action.phtml
Is it possible? If not, is it possible with another way?
Best regards,
Samuel ROZE.
没有评论:
发表评论