symfony:symfony_tutorial_notes:configuring_symfony
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
symfony:symfony_tutorial_notes:configuring_symfony [2015/09/16 22:00] – created mithat | symfony:symfony_tutorial_notes:configuring_symfony [2015/09/16 23:35] (current) – mithat | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Configuring Symfony ====== | + | ====== Configuring Symfony |
+ | The main configuration file lives in the app/config/ as a YAML, XML, (and/?) or PHP file. Only YAML is considered here. | ||
+ | |||
+ | <file yaml app/ | ||
+ | imports: | ||
+ | - { resource: parameters.yml } | ||
+ | - { resource: security.yml } | ||
+ | |||
+ | framework: | ||
+ | secret: | ||
+ | router: | ||
+ | # ... | ||
+ | |||
+ | # Twig Configuration | ||
+ | twig: | ||
+ | debug: | ||
+ | strict_variables: | ||
+ | |||
+ | # ... | ||
+ | </ | ||
===== Default Configuration Dump ===== | ===== Default Configuration Dump ===== | ||
+ | Dump the default configuration for a bundle in YAML to the console: | ||
+ | <code bash> | ||
+ | $ app/console config: | ||
+ | $ app/console config: | ||
+ | </ | ||
+ | |||
+ | ===== Environments ===== | ||
+ | |||
+ | Different environments share the same PHP code (apart from the front controller), | ||
+ | |||
+ | * Access '' | ||
+ | * Access '' | ||
+ | * The '' | ||
+ | |||
+ | To clear '' | ||
+ | <code bash> | ||
+ | $ php app/console cache:clear --env=prod --no-debug | ||
+ | </ | ||
+ | |||
+ | ==== Additional Environments ==== | ||
+ | |||
+ | To create a new environment, | ||
+ | <code php> | ||
+ | $kernel = new AppKernel(' | ||
+ | </ | ||
- | ==== Environments ==== | + | Then create a config file that matches the environment name but prefixed with '' |
- | ===== Environment Configuration ===== | + | <file yaml app/ |
+ | imports: | ||
+ | - { resource: config.yml } | ||
+ | framework: | ||
+ | router: | ||
+ | profiler: { only_exceptions: | ||
+ | # ... | ||
+ | </ |
symfony/symfony_tutorial_notes/configuring_symfony.1442440832.txt.gz · Last modified: 2015/09/16 22:00 by mithat