use yiicachingCache;$cache = Yii::$app->cache;$cache['var1'] = $value1; // equivalent to: $cache->set('var1', $value1);$value2 = $cache['var2']; // equivalent to: $value2 = $cache->get('var2');