|
|||
|
First I want to let you know beforehand that I'm not well familiar with MVC-concept and have difficulties with OOP. Nevertheless I want to make a modular and extensible site on top of ZF. That's why I'm asking you to tell me, whether I'm moving in the right direction.
In bootstrap I parse .ini to find out which modules are active and form a list with the names of these modules. Each module is an independent component with it's controller, model and view (navigation menu, 'who's online', links etc.). Then i set the controller name with the first entry in my list. In every post dispatch event in a front controller plugin I forward the request to the next entry in the list. And finally when the list is empty I call the original request. Each module passes it's rendered output to common buffer which is divided into logical sections ( $buffer->append('header', $view->render('template.tpl.php')) ). When all request are handled, the buffer is appended to response object. I'm not sure that's a good solution, but i have no idea how to make it otherwise. P.S. Sorry for my english |
|
||||
|
Hello,
Try this tutorial: Zend Framework Tutorial Is a full sample of using ZF for a MVC application.
__________________
Zend Framework Tutorials | Zend Framework Forums | Zend Framework IRC Channel | | Zend Framework Resources | CoreShifter | Microsoft Forums | Microsoft Links | Microsoft Books |
|
|||
|
The problem is that in tutorial only one controller and one method are responsible for the representation of the page. The headers, footers, navigation menu are just statical templates so it's really easy just to render them. But if I have something like "Last 5 topics from the forum" i must make an sql-query, process the data, render the template. And I have to do these operations in every action.
|
|
|||
|
I'm also trying to do render content from two distinct actions.
Namely one to produce navigation html (based on the request) and one to produce the main content. As far as I can see the best way to do this is to extend Zend_Controller_Action to automatically forward to another controller, and have all your controllers use this subclass. I didn't work out how to render the content into a specific section though - all the Zend_Layout tutorials demonstrate the default content placeholder. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|