public function render($writer)
{
if ($this->_dataCached) {
$writer->write($this->_contents);
} else {
if ($this->_cacheAvailable) {
$textwriter = new TTextWriter();
$multiwriter = new TOutputCacheTextWriterMulti(array($writer->getWriter(), $textwriter));
$htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), $multiwriter);
$stack = $this->getPage()->getCachingStack();
$stack->push($this);
parent::render($htmlWriter);
$stack->pop();
$content = $textwriter->flush();
$data = array($content, $this->_state, $this->_actions, time());
$this->_cache->set($this->getCacheKey(), $data, $this->getDuration(), $this->getCacheDependency());
} else {
parent::render($writer);
}
}
}