Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-14-2007, 01:14 PM
Junior Member
 
Join Date: Apr 2007
Location: Duisburg, Germany
Posts: 3
Default Site layout, modular structure

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-16-2007, 07:08 AM
Cristian's Avatar
Administrator
 
Join Date: Feb 2007
Location: Sibiu, Romania
Posts: 99
Default

Hello,

Try this tutorial:

Zend Framework Tutorial

Is a full sample of using ZF for a MVC application.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2007, 09:01 PM
Junior Member
 
Join Date: Apr 2007
Location: Duisburg, Germany
Posts: 3
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 02:51 PM
Junior Member
 
Join Date: Apr 2008
Posts: 1
Send a message via ICQ to tomas.fejfar
Default

You should use Zend_Layout for that It's available since ZF1.5,...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-30-2008, 08:30 AM
vonPetrushev's Avatar
Junior Member
 
Join Date: Apr 2008
Location: Macedonia
Posts: 1
Send a message via Yahoo to vonPetrushev
Default

hello, this is my first post to the forum

i have a similar question. I need to render this page:

header
-----------------------------
|
content #1 | content #2
|
----------------------------
footer

and both contents should be (active) results of 2 distinct actions

thanks,
vonPetushev
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-30-2008, 11:24 AM
Junior Member
 
Join Date: Oct 2007
Posts: 21
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:19 AM.