dnbwise
dnbwise

Reputation: 1102

Symfony custom config cascade

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?

Upvotes: 4

Views: 562

Answers (1)

Jeremy Kauffman
Jeremy Kauffman

Reputation: 10413

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');

Upvotes: 2

Related Questions