The thing is: I actually want the parameter in my URL, since it is significant to the user -- so storing it in the session is really not an option. I'd rather not rely on sessions (and thus enabled Cookies) for a critical part of the application anyway. (Of course, login/ logout is critical too and does require a Cookie, but you can expect users to activate them if they need to authenticate for a specific task).
So if there is no automated way, I'll probably solve it by adding a method __link() to my controller that adds the "layout" argument to any array passed and that I call wherever a link needs to be built. However, if anyone can suggest a better strategy I'll be happy to consider it. On 8 Jul., 04:31, "b logica" <[EMAIL PROTECTED]> wrote: > You could store it in the session and have your controllers check that > in beforeFilter(). Or, rather, check to see if it's in $this->params > first, then session, and finally have a default to fall back on. > > On Mon, Jul 7, 2008 at 5:52 AM, sam <[EMAIL PROTECTED]> wrote: > > > Dear Cake pros, > > > I have a route that allows me to switch the layout by supplying it as > > the first parameter in de URI. Example for using the "green" layout: > > >http://myhost/green/items/index > > > Here's the route: > > > Router::connect('/:layout/:controller/:action/*', array('controller' > > => 'items', 'action' => 'index') ,array('layout' => 'red|green')); > > > Now, I would like my controllers to propagate the "layout" parameter > > automatically, without requiring me to code this manually wherever I > > create a link or redirect to a page. Is this possible? > > > If not, what would be the best way to achieve this? > > > Thank you very much. > > Sam --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---
