PHP code example of tpoxa / yii2-settings

1. Go to this page and download the library: Download tpoxa/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.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tpoxa / yii2-settings example snippets


'components' => [        
    'settings'=>[
        'class'=>'johnitvn\settings\Settings'
    ],
],

$settings = Yii::$app->settings;

$value = $settings->get('section,'key');

$settings->set('section','key', 'value', 'integer');

$settings->delete('section,'key');

$settings->deleteAll('section,'key');

$settings->clearCache(); // automatic call when use set()


$settings->set($section,$key,$value,$type);

'modules' => [
    'settings' =>  [
        'class'=>'johnitvn\settings\Module',
    ]       
]

php composer.phar