Tuesday, February 19, 2013

Re: Use Configure::read in $components

On Tue, Feb 19, 2013 at 4:00 PM, Julien Itard <julienitard@gmail.com> wrote:
> Hi there,
> here is my AppController :
>
> public $components = array(
> 'TeamSpeak3.TeamSpeak3' => array(
> 'uri' => Configure::read('Settings.ts_uri)
> )
> );
>
> I need to use a configure here but it doesn't work ... any idea ?
>
> Thx from France :)

Salut,

You can't do that when declaring a class variable because it depends
on runtime info.

public $components = array(
'TeamSpeak3.TeamSpeak3'
);

function beforeFilter() {
$this->TeamSpeak3->uri = Configure::read(Settings.ts_uri);
}

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate