lib/Cache.php
function cache($key, $value): void {
    $viewRenderer = $this->viewRenderer;
    if (!$viewRenderer->enableCaching) eval("?>$value");
    else {
      /** @var \yii\caching\Cache $cache */
      $cache = $viewRenderer->cache;
      $cache->set([__CLASS__, $key], $value, $viewRenderer->cachingDuration);
      $this->load($key);
    }
  }
function cache($key, $value): void {
    $viewRenderer = $this->viewRenderer;
    if (!$viewRenderer->enableCaching) eval("?>$value");
    else {
      /** @var \yii\caching\Cache $cache */
      $cache = $viewRenderer->cache;
      $cache->set([__CLASS__, $key], $value, $viewRenderer->cachingDuration);
      $this->load($key);
    }
  }
function cache ( $ key , $ value ) : void { $ viewRenderer = $ this -> viewRenderer ; if ( ! $ viewRenderer -> enableCaching ) eval ( "?>$value" ) ; else { /** @var \yii\caching\Cache $cache */ $ cache = $ viewRenderer -> cache ; $ cache -> set ( [ __CLASS__ , $ key ] , $ value , $ viewRenderer -> cachingDuration ) ; $ this -> load ( $ key ) ; } }
Caches and loads a compiled view.
@param string $key The key identifying the view to be cached.
@param string $value The view to be cached.
Caches and loads a compiled view .