Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Is this EVIL in cake?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
lacenaepronta@gmail.com  
View profile  
 More options Nov 4, 12:44 am
From: "lacenaepro...@gmail.com" <lacenaepro...@gmail.com>
Date: Tue, 3 Nov 2009 05:44:58 -0800 (PST)
Local: Wed, Nov 4 2009 12:44 am
Subject: Is this EVIL in cake?
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() {


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lacenaepronta@gmail.com  
View profile  
 More options Nov 4, 12:47 am
From: "lacenaepro...@gmail.com" <lacenaepro...@gmail.com>
Date: Tue, 3 Nov 2009 05:47:34 -0800 (PST)
Local: Wed, Nov 4 2009 12:47 am
Subject: Re: Is this EVIL in cake?
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, "lacenaepro...@gmail.com" <lacenaepro...@gmail.com>
wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
euromark (munich)  
View profile  
 More options Nov 4, 2:52 am
From: "euromark (munich)" <dereurom...@googlemail.com>
Date: Tue, 3 Nov 2009 07:52:09 -0800 (PST)
Local: Wed, Nov 4 2009 2:52 am
Subject: Re: Is this EVIL in cake?
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, "lacenaepro...@gmail.com" <lacenaepro...@gmail.com>
wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Miles J  
View profile  
 More options Nov 4, 4:35 am
From: Miles J <mileswjohn...@gmail.com>
Date: Tue, 3 Nov 2009 09:35:21 -0800 (PST)
Local: Wed, Nov 4 2009 4:35 am
Subject: Re: Is this EVIL in cake?
Or you could just do it in the AppController::beforeFilter().

On Nov 3, 7:52 am, "euromark (munich)" <dereurom...@googlemail.com>
wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lacenaepronta@gmail.com  
View profile  
 More options Nov 4, 9:00 am
From: "lacenaepro...@gmail.com" <lacenaepro...@gmail.com>
Date: Tue, 3 Nov 2009 14:00:14 -0800 (PST)
Local: Wed, Nov 4 2009 9:00 am
Subject: Re: Is this EVIL in cake?
Thanks for the replies but now....HOW CAN I ACCESS THE MODEL FROM
WITHIN THE COMPONENT?

Dario

On 3 Nov, 18:35, Miles J <mileswjohn...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
AD7six  
View profile  
 More options Nov 4, 9:32 am
From: AD7six <andydawso...@gmail.com>
Date: Tue, 3 Nov 2009 14:32:19 -0800 (PST)
Local: Wed, Nov 4 2009 9:32 am
Subject: Re: Is this EVIL in cake?

On 3 nov, 23:00, "lacenaepro...@gmail.com" <lacenaepro...@gmail.com>
wrote:

> Thanks for the replies but now....HOW CAN I ACCESS THE MODEL FROM
> WITHIN THE COMPONENT?

you seem to have accidentally written most of your message(s) in
capital letters.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Amit  
View profile  
 More options Nov 4, 11:45 am
From: Amit <a...@amitvaria.com>
Date: Tue, 3 Nov 2009 16:45:42 -0800 (PST)
Local: Wed, Nov 4 2009 11:45 am
Subject: Re: Is this EVIL in cake?
http://filchiprogrammer.wordpress.com/2008/08/27/followthemanual/

On Nov 3, 4:32 pm, AD7six <andydawso...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lacenaepronta@gmail.com  
View profile  
 More options Nov 4, 7:02 pm
From: "lacenaepro...@gmail.com" <lacenaepro...@gmail.com>
Date: Wed, 4 Nov 2009 00:02:26 -0800 (PST)
Local: Wed, Nov 4 2009 7:02 pm
Subject: Re: Is this EVIL in cake?
OK, I don't know if it is the same to import and use the model or to
use the default model of the controller.

In the action I save the model like this:

$this->Group->Save

So in the component I'd like to set the locale just before the save. I
would put the code in the initialize callback of the component:

....
$this->controller->[...access the group model somehow...]->locale =
the_new_locale;
....

Sorry, but I don't know if this is the same of importing the model and
use it. Pheraps the right question is:

Does '$this->Group' works on an INSTANCE or on the CLASS??

Answer this question, and I will be a happy man.

THANKS!!

On 4 Nov, 01:45, Amit <a...@amitvaria.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
AD7six  
View profile  
 More options Nov 4, 7:09 pm
From: AD7six <andydawso...@gmail.com>
Date: Wed, 4 Nov 2009 00:09:17 -0800 (PST)
Local: Wed, Nov 4 2009 7:09 pm
Subject: Re: Is this EVIL in cake?

On 4 nov, 09:02, "lacenaepro...@gmail.com" <lacenaepro...@gmail.com>
wrote:

try

$this->controller->{$this->controller->modelClass}->locale =
'lowercase';

OR

ClassRegistry::init('ThisModel')->locale = 'lowercase';

Depending on if you want the controller's model irrespective of what
it is, or a specific model that may or may not be attached to the
controller.

hth,

AD


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lacenaepronta@gmail.com  
View profile  
 More options Nov 4, 9:57 pm
From: "lacenaepro...@gmail.com" <lacenaepro...@gmail.com>
Date: Wed, 4 Nov 2009 02:57:05 -0800 (PST)
Local: Wed, Nov 4 2009 9:57 pm
Subject: Re: Is this EVIL in cake?
Thank you, the modelClass solution is perfect!!!!

Long life to AD7six.

On 4 Nov, 09:09, AD7six <andydawso...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google