public renderDynamic ( string $statements ) : string | ||
$statements | string | the PHP statements for generating the dynamic content. |
return | string | the placeholder of the dynamic content, or the dynamic content if there is no active content cache currently. |
public function renderDynamic($statements)
{
if (!empty($this->cacheStack)) {
$n = count($this->dynamicPlaceholders);
$placeholder = "<![CDATA[YII-DYNAMIC-{$n}]]>";
$this->addDynamicPlaceholder($placeholder, $statements);
return $placeholder;
} else {
return $this->evaluateDynamicContent($statements);
}
}