PHP / MVC & layout question
| From: | Vincent DUPONT | Date: | Fri, 08 Dec 2006 07:16:58 +0000 |
| Subject: | PHP / MVC & layout question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-245639@lists.php.net to get a copy of this message | ||
Hello,
the Zend Framework, as others, offers a MVC implementation for PHP.
I guess my understanding of this is right, but I still have a question. Maybe you can help.
Depending on the request, a controller is called. This can do various stuff w/o model(s), and then
a view is displayed.
That is, only one vue is displayed at a time. We use this happily into applications where input or
list forms are displayed one at a time. The top banner template is included into every application
view so that is will always be displayed.
But I do not like the idea to embed (include) the top banner template into every view.
The problem is even more obvious when we want to create a 'portal' layout, displaying many
information panels, which should be splitted into many models/views.
For example, a portal homepage may display a login form, a news feed, a banner, a footer, a poll,
etc. When the user enters a bad username into the login form, we should re-display the portal page
and provide the error message near the login form.
So, the request to the login controller should be able to re-display the complete layout.
How do you handle this?
frames? iframes? ajax? other?
thanks for your interest.
Vincent