Or you could just do it in the AppController::beforeFilter().
On Nov 3, 7:52 am, "euromark (munich)" <[email protected]>
wrote:
> there are some components that work that way
> its not really evil...
> in some cases this would be the appropriate way actually
>
> On 3 Nov., 14:47, "[email protected]" <[email protected]>
> wrote:
>
> > SORRY, RETYPE AGAIN, I PRESSED THE SUBMIT BUTTON!!
>
> > HI,
>
> > I'm building a component that automatically sets the locale data
> > member of a translate behaviour.
>
> > In the action I look for the lang param, then call the component
> > method.
>
> > I'd like the component to set the locale data member in order to
> > avoid
> > to do that in ANY action.
>
> > Something like that:
>
> > // ------- component class
> > function initialize(&controller, .....) {
> > // HERE I SAVE THE CONTROLLER INSTANCE
> > $this->controller = $controller;
> > ....
>
> > }
>
> > function doSomething() {
> > // HERE I WANT TO ACCESS THE MODEL AND SET THE LOCALE
> > $mod = $this->controller->.....
> > $model->locale = $mySavedLocale;
>
> > }
>
> > IS THIS EVIL IN CAKE. IS THERE ANOTHER MVC ORIENTED METHOD?
>
> > THANKS!!
>
> > On 3 Nov, 14:44, "[email protected]" <[email protected]>
> > wrote:
>
> > > HI,
>
> > > I'm building a component that automatically sets the locale data
> > > member of a translate behaviour.
>
> > > In the action I look for the lang param, then call the component
> > > method.
>
> > > I'd like the component to set the locale data member in order to avoid
> > > to do that in ANY action.
>
> > > Something like that:
>
> > > // ------- component class
> > > function initialize(&controller, .....) {
> > > // HERE I SAVE THE CONTROLLER INSTANCE
> > > $this->controller = $controller;
> > > ....
>
> > > }
>
> > > function doSomething() {
>
> > > }- Nascondi testo citato
>
> > > - Mostra testo citato -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---