dev-master
9999999-dev https://github.com/t-kanstantsin/yii2-cache-modelCaching static models component for Yii 2 framework.
BSD-3-Clause
The Requires
- php >=5.5.0
- yiisoft/yii2 *
cache extension yii2 yii yii 2
Caching static models component for Yii 2 framework.
Component allows easy cache and get static models data like statuses, cities or categories. There are methods to manually clear cache in purpose to update those data., (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
$ php composer.phar require --prefer-dist t-kanstantsin/yii2-cache-model "*"
or add, (*4)
"t-kanstantsin/yii2-cache-model": "*"
to the require section of your composer.json
file., (*5)
To configure component place this code in config's component definition:, (*6)
'cacheModel' => [ 'class' => tkanstantsin\cache\CacheModel::class, 'cache' => 'cache', // cache component 'duration' => 86400, // caching time (it can't be greater than in 'cache' component) ],
\Yii::$app->cacheModel->get(foo\Foo::class);
\Yii::$app->cacheModel->get(foo\Foo::class, $fooId);
\Yii::$app->cacheModel->get(foo\Foo::class, [$fooId1, $fooId2]);
\Yii::$app->cacheModel->flush(foo\Foo::class);
The BSD License (BSD). Please see License File for more information., (*7)
Caching static models component for Yii 2 framework.
BSD-3-Clause
cache extension yii2 yii yii 2