Thanks for the replies but now....HOW CAN I ACCESS THE MODEL FROM
WITHIN THE COMPONENT?
Dario
On 3 Nov, 18:35, Miles J <
[hidden email]> wrote:
> Or you could just do it in the AppController::beforeFilter().
>
> On Nov 3, 7:52 am, "euromark (munich)" <
[hidden email]>
> 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, "
[hidden email]" <
[hidden email]>
> > 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, "
[hidden email]" <
[hidden email]>
> > > 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 -- 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
[hidden email]
To unsubscribe from this group, send email to
[hidden email]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en-~----------~----~----~----~------~----~------~--~---