2017 © Pedro Peláez
 

yii2-extension yii2-globalstate

Save and load global data

image

mrssoft/yii2-globalstate

Save and load global data

  • Friday, October 9, 2015
  • by mrs2000
  • Repository
  • 2 Watchers
  • 2 Stars
  • 70 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

yii2-globalstate

Save and load global data, (*1)

Install

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)

Usage

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);

The Versions

09/10 2015

dev-master

9999999-dev

Save and load global data

  Sources   Download

MIT

The Requires

 

by Melnikov Ruslan

extension yii2