1. Go to this page and download the library: Download yii2mod/yii2-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.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$settings = Yii::$app->settings;
$value = $settings->get('section', 'key');
$settings->set('section', 'key', 125.5);
$settings->set('section', 'key', 'false', SettingType::BOOLEAN_TYPE);
// Checking existence of setting
$settings->has('section', 'key');
// Activates a setting
$settings->activate('section', 'key');
// Deactivates a setting
$settings->deactivate('section', 'key');
// Removes a setting
$settings->remove('section', 'key');
// Removes all settings
$settings->removeAll();
// Get's all values in the specific section.
$settings->getAllBySection('section');
$settings->invalidateCache(); // automatically called on set(), remove();