In order to keep up with modern demands, today's frameworks and applications require a flexible configuration system. Symfony fulfils this role nicely through its robust configuration files and environments concept.
The default Symfony configuration file config.yml
is located under the app/config/
directory, with (partial) content sectioned as follows:
imports: - { resource: parameters.yml } - { resource: security.yml } - { resource: services.yml } framework: … # Twig Configuration twig: … # Doctrine Configuration doctrine: … # Swiftmailer Configuration swiftmailer: …
The top-level entries like framework
, twig
, doctrine
, and swiftmailer
define the configuration of an individual bundle.
Optionally, the configuration file can be of XML or PHP format (config.xml
or config.php
). While YAML is simple and readable, XML is more powerful, whereas PHP is powerful but less readable.
We can use the console tool to dump the entire configuration as shown here:
php bin/console...