on August 25, 2011. in Development, Programming. A 1 minute read.
I started to work on/figuring out the security part in Symfony2 and one part where the docs fail so far is to explain how to import security settings from a bundle.
Once I put some thinking into it, it’s pretty easy actually. Simply import the needed security file in your main config file. Something like this will work:
# app/config/config.yml
imports:
- { resource: parameters.ini }
- { resource: '@AcmeDemoBundle/Resources/config/security.xml' }
where the security.xml file is the same as already described in the documentation.
Happy hackin’!
P.S.: Bonus tip: When googling for symfony2 stuff, start your query with +symfony2 to include only symfony2 results. Makes life a bit easier.