1. Go to this page and download the library: Download fm-labs/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/ */
fm-labs / cakephp-settings example snippets
@TODO
// In your bootstrap.php or in Plugin::bootstrap()
\Cake\Core\Configure::load('app', 'settings');
// In your bootstrap.php or in Plugin::bootstrap()
\Cake\Core\Configure::load('PluginName', 'settings');
/**
*
*/
public function implementedEvents()
{
return [
'Settings.build' => 'buildSettings',
];
}
/**
* @param \Cake\Event\Event $event The event object
* @param \Settings\Settings $settings The settings object
* @return void
*/
public function buildSettings(Event $event, $settings)
{
// load a settings schema config file
//$settings->load('User.settings');
// add a setting group
$settings->addGroup('User.Password', [
'label' => 'User Password Settings'
]);
// add a setting
$settings->add('User.Password.expireInDays', [
'group' => 'User.Password',
'type' => 'int',
'label' => 'Password expiry (in days)',
'help' => 'The password will expire in X days and a new password needs to be entered by the user at the next login.'
]);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.