Configure Object as global variable storage

2007-02-21 Thread jyrgen

hi there,

i've utilized the Configure class in cake to store some app wide
settings, which are accessed in views as well as controllers.

now i would like to avoid initialising them as follows:

$this-set('rechte_values',Configure::read('rechte_values'));
$this-set('texttyp_values',Configure::read('texttyp_values'));
$this-set('ressort_values',Configure::read('ressort_values'));
$this-
set('darstellung_values',Configure::read('darstellung_values'));
$this-set('honorar_values',Configure::read('honorar_values'));

... and so on

is the a way to load/read all variables that i have defined ?
like traversing ??

thanks a lot again !

jyrgen


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



RE: Configure Object as global variable storage

2007-02-21 Thread Mariano Iglesias

Set the names of your config vars in the form of:

App.variable

So instead you would have:

$this-set('rechte_values',Configure::read('App.rechte_values'));
$this-set('texttyp_values',Configure::read('App.texttyp_values'));
$this-set('ressort_values',Configure::read('App.ressort_values'));
$this-
set('darstellung_values',Configure::read('App.darstellung_values'));
$this-set('honorar_values',Configure::read('App.honorar_values'));

And then do:

$result = Configure::read('App');

pr($result);

You'll see that you get an array with all variables starting with App.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar

-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de jyrgen
Enviado el: MiƩrcoles, 21 de Febrero de 2007 07:29 p.m.
Para: Cake PHP
Asunto: Configure Object as global variable storage

is the a way to load/read all variables that i have defined ?
like traversing ??

thanks a lot again !


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---