[PHP] PHP MVC

2006-03-29 Thread SLaVKa
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?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP MVC

2006-03-29 Thread SLaVKa

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?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] parent constructor

2006-03-29 Thread SLaVKa
Hey guys just a general question... if you have a 
parent::__constructor() call in your constructor function, should that 
call ideally be placed before or after the code inside the current 
constructor? or it doesnt really matter


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP MVC

2006-03-30 Thread SLaVKa

Hey all, thanks for all the help upfront!

In MVC I have a controller e.g PermissionController.php for my 
application which manages permissions of groups/users etc...


So a controller loads up, and assuming theres nothing passed in request 
loads the default module in this case Permissions. (module or model 
which ever you want to call it).


The controller calls the execute method on Permission module, and then 
the view method of that module.


My question is... the view needs to have a select box with all the 
groups so you can select the group for which you want to set the 
permissions for, how can i allow the permission module to retrieve this 
data and display it.


Basically would i need to do something like pass back an action from the 
permission module to the controller to call a function of the groups 
module to get the groups, or can i access the groups module directly 
from the permission module.


If anyone can help and maybe give me an diagram/example would be much 
appreciated.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP post data

2006-04-06 Thread SLaVKa

John Taylor-Johnston wrote:

Scrolling back and forward through my PHP generated search engine,
my browser (FF) alerts to remind me that I have post data.
What kind of header can I add to avoid it doing that?
Else what is the problem?
John

Try using GET

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Implied permissions

2006-04-09 Thread SLaVKa

Hey guys... implementing a permission system and just wanted some advice.

If i have permission A
which has implied permissions B and C

How do the permissions relate to each other, for eg if I select 
permission A to true, that implies that permission B and C must be set 
to true, but then if I set B to false or C to false, or both does that 
affect permission A?


Assuming that B, and C dont have implied rights you should be able to 
turn both of them off while leaving A on, but then that breaks the rule 
for A having implied permissions B and C.


Any help appreciated.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php