TwigNodeVisitor

Provides a Twig_NodeVisitor to change the generated parse-tree. This is used to ensure that everything printed is wrapped via the TwigExtension->renderVar() function in order to just write {{ content }} in templates instead of having to write {{ render_var(content) }}. Hierarchy class \Twig_BaseNodeVisitor implements \Twig_NodeVisitorInterface class \Drupal\Core\Template\TwigNodeVisitor See also twig_render File core/lib/Drupal/Core/Template/TwigNodeVisitor.php, line 14 Namespace Dr

TwigNodeVisitor::doEnterNode

protected TwigNodeVisitor::doEnterNode(\Twig_Node $node, \Twig_Environment $env) Called before child nodes are visited. Parameters Twig_Node $node The node to visit: Twig_Environment $env The Twig environment instance: Return value Twig_Node The modified node Overrides Twig_BaseNodeVisitor::doEnterNode File core/lib/Drupal/Core/Template/TwigNodeVisitor.php, line 19 Class TwigNodeVisitor Provides a Twig_NodeVisitor to change the generated parse-tree. Namespace Drupal\Core\Template Cod

TwigNodeVisitor::doLeaveNode

protected TwigNodeVisitor::doLeaveNode(\Twig_Node $node, \Twig_Environment $env) Called after child nodes are visited. Parameters Twig_Node $node The node to visit: Twig_Environment $env The Twig environment instance: Return value Twig_Node|false The modified node or false if the node must be removed Overrides Twig_BaseNodeVisitor::doLeaveNode File core/lib/Drupal/Core/Template/TwigNodeVisitor.php, line 26 Class TwigNodeVisitor Provides a Twig_NodeVisitor to change the generated parse-tr

TwigNodeVisitor::getPriority

public TwigNodeVisitor::getPriority() File core/lib/Drupal/Core/Template/TwigNodeVisitor.php, line 60 Class TwigNodeVisitor Provides a Twig_NodeVisitor to change the generated parse-tree. Namespace Drupal\Core\Template Code public function getPriority() { // Just above the Optimizer, which is the normal last one. return 256; }

TwigPhpStorageCache

Provides an alternate cache storage for Twig using PhpStorage. This class is designed to work on setups with multiple webheads using a local filesystem for the twig cache. When generating the cache key, a hash value depending on the enabled extensions is included. This prevents stale templates from being reused when twig extensions are enabled or disabled. Hierarchy class \Drupal\Core\Template\TwigPhpStorageCache implements Twig_CacheInterface See also \Drupal\Core\DependencyInjection\Compi

TwigPhpStorageCache::$cache

The cache object used for auto-refresh via mtime. Type: \Drupal\Core\Cache\CacheBackendInterface File core/lib/Drupal/Core/Template/TwigPhpStorageCache.php, line 25 Class TwigPhpStorageCache Provides an alternate cache storage for Twig using PhpStorage. Namespace Drupal\Core\Template Code protected $cache;

TwigPhpStorageCache::$storage

The PhpStorage object used for storing the templates. Type: \Drupal\Component\PhpStorage\PhpStorageInterface File core/lib/Drupal/Core/Template/TwigPhpStorageCache.php, line 32 Class TwigPhpStorageCache Provides an alternate cache storage for Twig using PhpStorage. Namespace Drupal\Core\Template Code protected $storage;

TwigPhpStorageCache::$templateCacheFilenamePrefix

The template cache filename prefix. Type: string File core/lib/Drupal/Core/Template/TwigPhpStorageCache.php, line 39 Class TwigPhpStorageCache Provides an alternate cache storage for Twig using PhpStorage. Namespace Drupal\Core\Template Code protected $templateCacheFilenamePrefix;

TwigPhpStorageCache::generateKey

public TwigPhpStorageCache::generateKey($name, $className) Generates a cache key for the given template class name. Parameters string $name The template name: string $className The template class name: Return value string Overrides Twig_CacheInterface::generateKey File core/lib/Drupal/Core/Template/TwigPhpStorageCache.php, line 69 Class TwigPhpStorageCache Provides an alternate cache storage for Twig using PhpStorage. Namespace Drupal\Core\Template Code public function generateKey($n

TwigPhpStorageCache::getTimestamp

public TwigPhpStorageCache::getTimestamp($key) Returns the modification timestamp of a key. Parameters string $key The cache key: Return value int Overrides Twig_CacheInterface::getTimestamp File core/lib/Drupal/Core/Template/TwigPhpStorageCache.php, line 106 Class TwigPhpStorageCache Provides an alternate cache storage for Twig using PhpStorage. Namespace Drupal\Core\Template Code public function getTimestamp($key) { $cid = 'twig:' . $key; if ($cache = $this->cache->get($c