PHP code example of jeffersonsimaogoncalves / cakephp-settings
1. Go to this page and download the library: Download jeffersonsimaogoncalves/cakephp-settings library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jeffersonsimaogoncalves / cakephp-settings example snippets
Plugin::load('Settings', ['bootstrap' => true, 'routes' => true]);
// or run in your shell
$ bin/cake plugin load -b -r Settings
use Settings\Core\Setting;
Setting::write('App.Name', 'Custom Name');
Setting::read('App.Name');
Setting::register('App.Name', 'Default Value', []);
Setting::register('App.Index', false, [
'options' => function() {
return TableRegistry::get('Blogs')->find('list')->toArray();
}
]);
Configure::write('Settings.Prefixes.Test', 'Test');