dev-master
9999999-devSave and load global data
MIT
The Requires
by Melnikov Ruslan
extension yii2
Save and load global data
Save and load global data, (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist mrssoft/yii2-globalstate "dev-master"
or add, (*4)
"mrssoft/yii2-globalstate": "dev-master"
to the require section of your composer.json, (*5)
Add to you config:, (*6)
'components' => [ 'globalstate' => [ 'class' => 'mrssoft\globalstate\GlobalStateFile', 'path' => '@runtime', // Path for save data (optional) 'filename' => 'globalstate.bin' //Filename (optional) ], ]
Get value:, (*7)
$value = Yii::$app->globalstate->get('key'); //or $value = Yii::$app->globalstate->get('key', $default);
Set value:, (*8)
Yii::$app->globalstate->set('key', $value);
Save and load global data
MIT
extension yii2