sfConstPlugin - 1.0.0
You are currently browsing
the website for symfony 1
|Voznyak Nazar||lead||moc.liamg <<ta>> razankaynzov|
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.
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.
Install the plugin
symfony plugin-install http://plugins.symfony-project.com/sfConstPlugin
Enable module in your
all: .settings: enabled_modules: sfConst
Clear you cache
Access the constants management module with the default route:
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)