Prado\Web\UI\WebControls\TOutputCache::render PHP 메소드

render() 공개 메소드

This method overrides the parent implementation by capturing the output from its child controls and saving it into cache, if output cache is needed.
public render ( $writer )
    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);
            }
        }
    }