# sfConst plugin The `sfConstPlugin` is a symfony plugin that provides app wide constants functionality. It automatically generates constant values based on sf_const table values and make them accessible in every app module. This plugin's functionality is quite similar to sfSettingsPlugin functionality. The difference is that this plugin automatically generates unique constant names based on constant name and reference to pair of table/field. Plugin can be helpfull if you have a big number of reference tables like statuses, types, etc and don't want to create atomic tables for each table reference. ## Installation * Install the plugin symfony plugin-install http://plugins.symfony-project.com/sfConstPlugin * Enable module in your `settings.yml` * sfConst all: .settings: enabled_modules: [sfConst ](default,) * Clear you cache symfony cc ### Manage constants * Access the constants management module with the default route: http://www.example.com/backend.php/sfConst ### 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_const.yml')); * You're done. ## TODO * created_user_id, updated_user_id - implement this functionality so table remembers who has changed the values