Copyright (c) 2007 Voznyak Nazar
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
sfAdavancedConst plugin
The sfAdvancedConstPlugin is a symfony plugin that provides app wide constants functionality.
It automatically generates constant values based on sfRefTable values and make them accessible in every app module.
It works the following way - go through the tables defined in sfRefTable and generate for each id / name pair from this
table constants. This plugin is different from sfConst plugin which required to keep all the constants directly in
sfConst table and did not require ref tables. Effectively, both plugins are usefull to be used.
Installation
Manage constants
Use constants in your application
To use constants from sf_setting table in a symfony project:
Put the following line into your main controller symfony file (i.e. index.php, frontend_dev.php, backend.php, etc)
include_once (sfConfigCache::getInstance()->checkConfig('config/db_advanced_const.yml'));
You're done.