PHP code example of futuretek / yii2-options

1. Go to this page and download the library: Download futuretek/yii2-options 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/ */

    

futuretek / yii2-options example snippets


return [
    'components' => [
        'options' => [
            'class' => 'futuretek\options\Option',
            'configFile' => __DIR__ . '/options.php',
            'enableCaching' => true,
        ],     
    ],
];

$value = \Yii::$app->options->get('OPTION_NAME');

\Yii::$app->options->set('OPTION_NAME', $value);

$userValue = \Yii::$app->options->get('OPTION_NAME', self::class, $this->getPrimaryKey());
\Yii::$app->options->set('OPTION_NAME', $userValue, self::class, $this->getPrimaryKey());

php composer.phar