The app.yml Configuration File
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.
インデックス
Document Index
関連ページリスト
Related Pages
- Introduction
- The YAML Format
- Configuration File Principles
- The settings.yml Configuration File
- The factories.yml Configuration File
- The generator.yml Configuration File
- The databases.yml Configuration File
- The security.yml Configuration File
- The cache.yml Configuration File
- The routing.yml Configuration File
- The app.yml Configuration File
- The filters.yml Configuration File
- The view.yml Configuration File
- Other Configuration Files
- Events
- Tasks
- Appendix A - License
日本語ドキュメント
Japanese Documents
- 2011/01/18 Chapter 17 - Extending Symfony
- 2011/01/18 The generator.yml Configuration File
- 2011/01/18 Les tâches
- 2011/01/18 Emails
- 2010/11/26 blogチュートリアル(8) ビューの作成