yii2缓存

use yii\caching\Cache;
$cache Yii::$app->cache;
$cache['var1'] = $value1;  // equivalent to: $cache->set('var1', $value1);
$value2 $cache['var2'];  // equivalent to: $value2 = $cache->get('var2');
posted @ 2017-05-02 13:27  pengcx  阅读(103)  评论(0编辑  收藏  举报