This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

module.yml don't load settings

Discussion specific to symfony 1.1.x stable

module.yml don't load settings

by marcos » Tue Jul 22, 2008 4:45 pm

Hi...

I write in the module.yml the settings of my module in the path

apps/frontend/modules/xxxmodule/config/module.yml

Code: Select all
all:        # Setting for all environments
    initialmoney:     1000000


I debug symfony with Eclipse and I show that in the variable:
contex -> configuration -> config[] is load all the sf_ settings and app_ settings but not the mod_ settings.

The sfConfig::get('mod_initialmoney') returns null

What is the problem??
Thanks....!!!
marcos
Junior Member
 
Posts: 4
Joined: Tue Jul 22, 2008 12:05 pm

Re: module.yml don't load settings

by WolfEng » Wed Jul 23, 2008 3:36 am

Have you tried clearing cache?? This could be the first aproach solution with the info you provide :)~ :-)~ :smile: , use the command:

Code: Select all
symfony cache:clear


in order to clear it, cheers!

.:WolfEng:.
WolfEng
Junior Member
 
Posts: 28
Joined: Tue Jul 22, 2008 8:54 am

Re: module.yml don't load settings

by marcos » Wed Jul 23, 2008 8:15 am

Yes... I cleared cache all the times...!!

I use...

Code: Select all
symfony cc


that I supose it's equals than

Code: Select all
symfony cache:clear
marcos
Junior Member
 
Posts: 4
Joined: Tue Jul 22, 2008 12:05 pm

Re: module.yml don't load settings

by michael.piecko » Wed Jul 23, 2008 9:42 am

One more info:
The module.yml is only created and loaded when xxxmodule is executed thie first time. So when you clear the cache and try to get this value from onother place, before xxxmodule module was called, this will fail. This settings are not available until xxxmodule was called the first time.

Michael
michael.piecko
Faithful Member
 
Posts: 624
Joined: Fri Jun 30, 2006 5:56 pm
Location: Germany

Re: module.yml don't load settings

by michael.piecko » Wed Jul 23, 2008 9:44 am

Sorry i forgot, you have to call

Code: Select all
sfConfig::get('mod_xxxmodule_initialmoney');

not

Code: Select all
sfConfig::get('mod_initialmoney');

Michael
michael.piecko
Faithful Member
 
Posts: 624
Joined: Fri Jun 30, 2006 5:56 pm
Location: Germany

Re: module.yml don't load settings

by marcos » Wed Jul 23, 2008 5:12 pm

Hi....

I follow your instructions and nothing happens....

I made this....

1) symfony cache:clear
2) http://localhost/frontend_dev.php/register
3) in the executeIndex
Code: Select all
    echo "====>".sfConfig::get('mod_initialmoney');


This return a empty value.....
marcos
Junior Member
 
Posts: 4
Joined: Tue Jul 22, 2008 12:05 pm

Re: module.yml don't load settings

by michael.piecko » Wed Jul 23, 2008 5:17 pm

No you didn't 8-) , see my post:

michael.piecko wrote: Sorry i forgot, you have to call

Code: Select all
sfConfig::get('mod_xxxmodule_initialmoney');

not

Code: Select all
sfConfig::get('mod_initialmoney');

Michael



Tell me the name of the module, where your module.yml is.

Michael
michael.piecko
Faithful Member
 
Posts: 624
Joined: Fri Jun 30, 2006 5:56 pm
Location: Germany

[Solved] Re: module.yml don't load settings

by marcos » Wed Jul 23, 2008 5:43 pm

AAAAAAAHHHHHH!!!!!!

Yes.... I put the name of the module and It's works.

Now.... this return the value....

A lot of thanks.....!!!

Greetings!!!!
marcos
Junior Member
 
Posts: 4
Joined: Tue Jul 22, 2008 12:05 pm

Re: module.yml don't load settings

by jfgrissom » Fri Feb 11, 2011 7:50 pm

@michael.piecko

Thanks for clarifying this...

I was having the same problem (and thinking the exact same thing as Marcos.)

The addition of the app_ (or mod_xxx_) in front of the key name is missing link, and I'll never forget it now...

(Funny because, had I just copy and pasted from the [Day 6] text it would have worked just fine, but I wouldn't have learned this nearly as clearly. I remember reading it previously, but now it sticks.)

I really appreciate your help Michael... Thanks!

:D~:-D~:grin:
User avatar
jfgrissom
Faithful Member
 
Posts: 228
Joined: Tue Jan 25, 2011 7:24 pm
Location: San Diego