Re: PHP MVC

From: Date: Thu, 30 Mar 2006 05:58:25 +0000
Subject: Re: PHP MVC
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-232886@lists.php.net to get a copy of this message
Paul Scott wrote:
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
So you only have one level of actions/views , what happens in a situation where the page you are loading has various sections which want either displayed or hidden?

« previous php.general (#232886) next »