I am developing a somewhat complex, mostly AJAX application using symfony 1.4. It would be very helpful for me to use some custom properties for my modules, which I defined in the module.yml configuration files, for example:
all:
first_property: value1
second_property: value2
etc.
This properties would be used mainly for formatting views generated by javascript, using JSON values returned from my modules. For example – in my main module (used to render the base view) controller I wanted to use something like that:
// In frontend/modules/main
$property sfConfig::get('mod_somemodule_someproperty');
It won’t work because by default properties of a module are not accessible outside of the module by the sfConfig::get() method.
My question is:
Is it possible to somehow access these properties?
If not – I would be really grateful if somebody suggested a different way in which I could specify some recurring attributes for my modules and the access them from an outside controller.
Thanks.
I guess you’re familiar with the
app.ymlconfig? Which is used to store configuration settings through the whole application, not just the selected module. This is the place to store more generic settings…But, that said. You could just open the
module.ymlof your choice with thesfYamlclass. Something like this (pseudo code)Optionally, you could merge the items
allkey with the selected environment.