public function run()
{
if (($content = $this->getCachedContent()) !== false) {
echo $content;
} elseif ($this->cache instanceof Cache) {
array_pop($this->getView()->cacheStack);
$content = ob_get_clean();
if ($content === false || $content === '') {
return;
}
if (is_array($this->dependency)) {
$this->dependency = Yii::createObject($this->dependency);
}
$data = [$content, $this->dynamicPlaceholders];
$this->cache->set($this->calculateKey(), $data, $this->duration, $this->dependency);
if (empty($this->getView()->cacheStack) && !empty($this->dynamicPlaceholders)) {
$content = $this->updateDynamicContent($content, $this->dynamicPlaceholders);
}
echo $content;
}
}