The symfony Reference Book

The app.yml Configuration File

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


About

You are currently reading "The symfony Reference Book" which is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License license.

Master symfony

Be trained by SensioLabs experts (2 to 6 day sessions -- French or English).
trainings.sensiolabs.com

Books on symfony

Learn more about symfony with the official guides.
books.sensiolabs.com

L'audit Qualité par SensioLabs

200 points de contrôle de votre applicatif web.
audit.sensiolabs.com
symfony training
Be trained by symfony experts
Feb 21: Köln (Getting Started with Symfony2 - English)
Feb 27: Köln (Mastering Symfony2 - English)
Mar 05: Köln (Web Development with Symfony2 - Deutsch)
Mar 05: Montreal (Web Development with Symfony2 - English)
Mar 05: Montreal (Getting Started with Symfony2 - English)
and more...

Search


powered by google
You are currently browsing "The symfony Reference Book" in English for the 1.4 version - Switch to version: - Switch to language:
Creative Commons License This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
The symfony reference guide
Support symfony!
Buy this book
or donate.
Buy The symfony reference guide from amazon.com

The symfony framework provides a built-in configuration file for application specific settings, the app.yml configuration file.

This YAML file can contain any setting you want that makes sense for your specific application. In the code, these settings are available through the global sfConfig class, and keys are prefixed with the app_ string:

sfConfig::get('app_active_days');

All settings are prefixed by app_ because the sfConfig class also provides access to symfony settings and project directories.

As discussed in the introduction, the app.yml file is environment-aware, and benefits from the configuration cascade mechanism.

The app.yml configuration file is a great place to define settings that change based on the environment (an API key for instance), or settings that can evolve over time (an email address for instance). It is also the best place to define settings that need to be changed by someone who does not necessarily understand symfony or PHP (a system administrator for instance).

Refrain from using app.yml to bundle application logic.

The app.yml configuration file is cached as a PHP file; the process is automatically managed by the sfDefineEnvironmentConfigHandler class.

The filters.yml Configuration File »
« The routing.yml Configuration File

Questions & Feedback

If you find a typo or an error, please register and open a ticket.

If you need support or have a technical question, please post to the official user mailing-list.