Re: Best Practice for Views

2007-08-01 Thread starkey
Grant & Geoff, that's a pretty cool solution! On Jul 31, 7:56 pm, Geoff Ford <[EMAIL PROTECTED]> wrote: > I'm with grant - use one action with a differnt view as needed > > function action1($layout = 'list'){ > // set data and other stuff > switch ($layout){ > case 'table': > $this

Re: Best Practice for Views

2007-07-31 Thread Geoff Ford
I'm with grant - use one action with a differnt view as needed function action1($layout = 'list'){ // set data and other stuff switch ($layout){ case 'table': $this->render('action1_table'); break; default: $this->render('action1_list'); break; } } You could

Re: Best Practice for Views

2007-07-31 Thread Grant Cox
One of the primary parts of Cake is to keep your data separate from your application interface (controllers), separate from your presentation (views). Changing one of these elements should not require modification to the others. You want the first two to remain the same, you just want different

Re: Best Practice for Views

2007-07-31 Thread starkey
I think that would be overkill (and unnecessarily complex). Besides, you'd need to setup a model to get to your views... I suggest sticking with how Cake does things (which is pretty darn good). On Jul 31, 2:23 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > That's what I'll probably end up

Re: Best Practice for Views

2007-07-31 Thread [EMAIL PROTECTED]
That's what I'll probably end up doing since I'm still prototyping this stuff out. I'm guessing it would be better practice to have multiple view files instead of combining several views in one thtml file and also having several different controller actions. I'm just left here thinking about oth

Re: Best Practice for Views

2007-07-31 Thread starkey
I think I understand... It sounds to me like you should have two actions, not one: http://www.some.com/controller/viewList/ http://www.some.com/controller/viewTable/ Having one view to encapsulate two doesn't sound correct... but I'm still new at this myself. On Jul 31, 12:48 pm, "[EMAIL PROTEC

Re: Best Practice for Views

2007-07-31 Thread [EMAIL PROTECTED]
Thanks for the reply! The problem I am running into is that I need different views for the same information. For example, when someone visits http://www.some.com/controller/view/1 it will show say a list of links. In http://www.some.com/controller/view/2 it will show similar information from t

Re: Best Practice for Views

2007-07-31 Thread starkey
Couldn't you create an Element for the data? http://manual.cakephp.org/chapter/views On Jul 30, 6:58 pm, Grant Cox <[EMAIL PROTECTED]> wrote: > Are you talking about several different "skins", but really the same > data and presentation? Or are you talking about some non-trivial data > calculat

Re: Best Practice for Views

2007-07-30 Thread Grant Cox
Are you talking about several different "skins", but really the same data and presentation? Or are you talking about some non-trivial data calculation, then you want to show the result in several independent areas of your site? I'm just not sure of the reason for the several views on a single ac