If this is a site-wide "stage", I assume it will be stored somewhere.
If so, why not use some router magic?
switch (STAGE)
{
case 1:
Router::connect('/contests/*', array('controller' =>
'submissions'));
break;
case 2:
Router::connect('/contests/*', array('controller' =>
'votings'));
break;
case 3:
Router::connect('/contests/*', array('controller' => 'awards'));
break;
}
I'm not sure if this would work, but it's an idea..
On Apr 6, 11:52 pm, zonium <[EMAIL PROTECTED]> wrote:
> If you choose to have one controller, how about using a stage prefix
> for the methods in the controller, then use beforeFilter to set the
> actual action based on the stage.
> Users still access controllers/action, but depending on the stage
> (determined by your application logic), different actions pertaining
> to the stage are invoked.
> stage1_index()
> stage2_index()
> Same naming convention for view.
> Just a quick thought
>
> Zonium
>
> On Apr 3, 12:15 pm, John R <[EMAIL PROTECTED]> wrote:
>
> > My application is a series of "contests" with different stages
> > (submission, voting, awards, etc.)
>
> > For each stage, the site is going to function completely differently.
> > During Stage 1 (submission) for instance, you will be able to upload,
> > critique, etc. The front page will be a huge list of all submissions,
> > etc. During Stage 2 (voting), you will not be able to upload, only
> > vote on submissions from Stage 1. etc.etc.etc.etc.
>
> > I am having a hard time coming up with a good method for this. The
> > current stage is stored in the Contests table of the database.
> > Ideally, I would like to basically have a different controller for
> > each stage - so it would have it's own functions, views, etc. - but at
> > the end of the day - its just a part of the contests_controller. I
> > also thought of running a check for the current stage in
> > beforeRender() of the contests_controller and then redirecting or
> > pointing somewhere else, but I just dont know! Any feedback would be
> > great!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---