Friday, 15 July 2011

Adding custom configuration in config.yml in Symfony 2.1 -



Adding custom configuration in config.yml in Symfony 2.1 -

i want custom configuration parameters in config.yml example: in config.yml file

security_enhancement: authentication:true authorization:true

in same format swiftmailer configuration etc.i'm not getting thought how define. i'm getting error like:

1/2 parseexception: unable parse in "\/var\/www\/demo\/app\/config\/config.yml" @ line 217 (near "authentication:true").

am missing here? necessary add together in depending injection extension file? .actually want enable disable authentication,authorization execution during dev mode implemented in listener can done using config_dev.yml . don't want add together under parameters. suggestions?

as you've rightly theorised, indeed need add together in di extension files, assuming configuration relates particular bundles (which will).

whilst parameters can defined @ will, configuration features hierarchical construction , validation.

usually, configuration used in turn, define parameters, allows values parsed , validated prior instantiation, bundle writers can provide improve guidance how services can used (with meaningful errors), , trust values beingness passed them.

a decent read on how started config component can found in symfony2 docs: defining , processing configuration files config component.

config symfony-2.1

No comments:

Post a Comment