Jarves\PluginController::renderCached PHP 메소드

renderCached() 보호된 메소드

In this cache method, the template engine is always called. If you want to cache this as well, use renderFullCached(). Example: return $this->renderCache('myCache', 'plugin1/default.tpl', function(){ return array('items' => heavyDbQuery()); }); Note: The $data callable is only called if the cache needs to regenerate (when it has been invalidated or empty, or the view file changed). If the callable $data returns NULL, then this will return NULL, too.
또한 보기: method `render` to get more information.
protected renderCached ( string $cacheKey, string $view, array | callable $data = null ) : string
$cacheKey string
$view string
$data array | callable Pass the data as array or a data provider function.
리턴 string
    protected function renderCached($cacheKey, $view, $data = null)
    {
        /** @var ResponseCacher $responseCacher */
        $responseCacher = $this->get('jarves.cache.response_cacher');
        return $responseCacher->renderCached($cacheKey, $view, $data);
    }