Setting: Database driven setting plugin for CakePHP.
, (*1)
Install
First, Install 'Setting' by recipe.php , and set CakePlugin::load('Setting', array('bootstrap' => true));
, (*2)
Second, Create schema., (*3)
./lib/Cake/Console/cake schema create settings --plugin Setting
Usage
Init
Configure Setting.settings
like Model::validate., (*4)
Configure::write('Setting.settings', array(
'tax_rate' => array('rule' => array('numeric')),
));
Set setting
Setting::setSetting([key], [value])
or Setting::setSetting(array([key1] => [value1], [key2] => [value2]))
, (*5)
Get setting
Setting::getSetting([key])
or Setting::getSetting()
, (*6)
If you want not to use Setting (settings table)
See SystemControlTest.php., (*7)
License
the MIT License, (*8)