TwigPhpStorageCache::load

public TwigPhpStorageCache::load($key) Loads a template from the cache. Parameters string $key The cache key: Overrides Twig_CacheInterface::load File core/lib/Drupal/Core/Template/TwigPhpStorageCache.php, line 89 Class TwigPhpStorageCache Provides an alternate cache storage for Twig using PhpStorage. Namespace Drupal\Core\Template Code public function load($key) { $this->storage()->load($key); }

TwigPhpStorageCache::storage

protected TwigPhpStorageCache::storage() Gets the PHP code storage object to use for the compiled Twig files. Return value \Drupal\Component\PhpStorage\PhpStorageInterface File core/lib/Drupal/Core/Template/TwigPhpStorageCache.php, line 59 Class TwigPhpStorageCache Provides an alternate cache storage for Twig using PhpStorage. Namespace Drupal\Core\Template Code protected function storage() { if (!isset($this->storage)) { $this->storage = PhpStorageFactory::get('twig');

TwigPhpStorageCache::write

public TwigPhpStorageCache::write($key, $content) Writes the compiled template to cache. Parameters string $key The cache key: string $content The template representation as a PHP class: Overrides Twig_CacheInterface::write File core/lib/Drupal/Core/Template/TwigPhpStorageCache.php, line 96 Class TwigPhpStorageCache Provides an alternate cache storage for Twig using PhpStorage. Namespace Drupal\Core\Template Code public function write($key, $content) { $this->storage()->save($

TwigPhpStorageCache::__construct

public TwigPhpStorageCache::__construct(CacheBackendInterface $cache, $twig_extension_hash) Store cache backend and other information internally. Parameters \Drupal\Core\Cache\CacheBackendInterface $cache: The cache bin. string $twig_extension_hash: The Twig extension hash. File core/lib/Drupal/Core/Template/TwigPhpStorageCache.php, line 49 Class TwigPhpStorageCache Provides an alternate cache storage for Twig using PhpStorage. Namespace Drupal\Core\Template Code public function __con

TwigSandboxPolicy

Default sandbox policy for Twig templates. Twig's sandbox extension is usually used to evaluate untrusted code by limiting access to potentially unsafe properties or methods. Since we do not use ViewModels when passing objects to Twig templates, we limit what those objects can do by whitelisting certain classes, method names, and method names with an allowed prefix. All object properties may be accessed. Hierarchy class \Drupal\Core\Template\TwigSandboxPolicy implements Twig_Sandbox_SecurityPol

TwigSandboxPolicy::$whitelisted_classes

An array of class names for which any method calls are allowed. File core/lib/Drupal/Core/Template/TwigSandboxPolicy.php, line 32 Class TwigSandboxPolicy Default sandbox policy for Twig templates. Namespace Drupal\Core\Template Code protected $whitelisted_classes = NULL;

TwigSandboxPolicy::$whitelisted_methods

An array of whitelisted methods in the form of methodName => TRUE. File core/lib/Drupal/Core/Template/TwigSandboxPolicy.php, line 21 Class TwigSandboxPolicy Default sandbox policy for Twig templates. Namespace Drupal\Core\Template Code protected $whitelisted_methods = NULL;

TwigSandboxPolicy::$whitelisted_prefixes

An array of whitelisted method prefixes -- any method starting with one of these prefixes will be allowed. File core/lib/Drupal/Core/Template/TwigSandboxPolicy.php, line 27 Class TwigSandboxPolicy Default sandbox policy for Twig templates. Namespace Drupal\Core\Template Code protected $whitelisted_prefixes = NULL;

TwigSandboxPolicy::checkMethodAllowed

public TwigSandboxPolicy::checkMethodAllowed($obj, $method) Overrides Twig_Sandbox_SecurityPolicyInterface::checkMethodAllowed File core/lib/Drupal/Core/Template/TwigSandboxPolicy.php, line 79 Class TwigSandboxPolicy Default sandbox policy for Twig templates. Namespace Drupal\Core\Template Code public function checkMethodAllowed($obj, $method) { foreach ($this->whitelisted_classes as $class => $key) { if ($obj instanceof $class) { return TRUE; } } // Return q

TwigSandboxPolicy::checkPropertyAllowed

public TwigSandboxPolicy::checkPropertyAllowed($obj, $property) Overrides Twig_Sandbox_SecurityPolicyInterface::checkPropertyAllowed File core/lib/Drupal/Core/Template/TwigSandboxPolicy.php, line 74 Class TwigSandboxPolicy Default sandbox policy for Twig templates. Namespace Drupal\Core\Template Code public function checkPropertyAllowed($obj, $property) { }