In Symfony 1.4, is it possible for one to define a custom config file (e.g. my_config.yml) that allows cascading; for instance, having a global custom config file and a module level analogue?
1 Answer
Yes.
Define a config handler in config_handlers.yml. It'll probably look like:
config/my_config.yml:
class: myConfigHandler
Write your config handler. You can look at many of the other config handlers in lib/config for examples. You'll likely want to extend sfYamlConfigHandler.
To access your config values:
sfContext::getInstance()->getConfigCache()->checkConfig('/config/my_config.yml');
1 Comment
dnbwise
is it a must to define a custom config handler, or is it sometimes ok to use one of the handlers defined in the symfony lib directory? (e.g. sfDefineEnvironmentConfigHandler.class.php)