Documentation

TwigTokenParserCache extends AbstractTokenParser
in package

Adds ability to cache Twig between tags.

{% cache 600 %} {{ some_complex_work() }} {% endcache %}

Also can provide a unique key for the cache:

{% cache "prefix-"~lang 600 %}

Where the "prefix-"~lang will use a unique key based on the current language. "prefix-en" for example

Table of Contents

Methods

decideCacheEnd()  : bool
getTag()  : string
parse()  : mixed

Methods

decideCacheEnd()

public decideCacheEnd(Token $token) : bool
Parameters
$token : Token
Return values
bool

        
On this page

Search results