Re: PHP MVC
| From: | Paul Scott | Date: | Thu, 30 Mar 2006 05:43:02 +0000 |
| Subject: | Re: PHP MVC | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-232885@lists.php.net to get a copy of this message | ||
On Thu, 2006-03-30 at 15:29 +1000, SLaVKa wrote:
> Hey all, I am desiging my own MVC framework, now i know you can pass
> views in the string like index.php?view=displayAdmin , but what if the
> admin model has a choice of displaying a few views as well, like editing
> user, or editing product etc, how do i pass subviews, in other words is
> there elegant solution someone can suggest?
>
You could take a look at the way we do it in our MVC Framework.
Basically in the controller you set up a switch with "action" cases.
depending on the action in the query string, it will return a template.
To see it in action, go to http://fsiu.uwc.ac.za
get the code at http://avoir.uwc.ac.za/projects/nextgen/ I would
recommend doing an anonymous CVS checkout here, as we only do a new
release on Friday...
--Paul