TwigExtension::attachLibrary

public TwigExtension::attachLibrary($library) Attaches an asset library to the template, and hence to the response. Allows Twig templates to attach asset libraries using {{ attach_library('extension/library_name') }} Parameters string $library: An asset library. File core/lib/Drupal/Core/Template/TwigExtension.php, line 360 Class TwigExtension A class providing Drupal Twig extensions. Namespace Drupal\Core\Template Code public function attachLibrary($library) { // Use Renderer::ren

TwigExtension::$urlGenerator

The URL generator. Type: \Drupal\Core\Routing\UrlGeneratorInterface File core/lib/Drupal/Core/Template/TwigExtension.php, line 33 Class TwigExtension A class providing Drupal Twig extensions. Namespace Drupal\Core\Template Code protected $urlGenerator;

TwigExtension::$themeManager

The theme manager. Type: \Drupal\Core\Theme\ThemeManagerInterface File core/lib/Drupal/Core/Template/TwigExtension.php, line 47 Class TwigExtension A class providing Drupal Twig extensions. Namespace Drupal\Core\Template Code protected $themeManager;

TwigExtension::$renderer

The renderer. Type: \Drupal\Core\Render\RendererInterface File core/lib/Drupal/Core/Template/TwigExtension.php, line 40 Class TwigExtension A class providing Drupal Twig extensions. Namespace Drupal\Core\Template Code protected $renderer;

TwigExtension::$dateFormatter

The date formatter. Type: \Drupal\Core\Datetime\DateFormatterInterface File core/lib/Drupal/Core/Template/TwigExtension.php, line 54 Class TwigExtension A class providing Drupal Twig extensions. Namespace Drupal\Core\Template Code protected $dateFormatter;

TwigExtension

A class providing Drupal Twig extensions. This provides a Twig extension that registers various Drupal-specific extensions to Twig, specifically Twig functions, filter, and node visitors. Hierarchy class \Drupal\Core\Template\TwigExtension extends \Twig_Extension See also \Drupal\Core\CoreServiceProvider File core/lib/Drupal/Core/Template/TwigExtension.php, line 26 Namespace Drupal\Core\Template Members Name Modifiers Type Description TwigExtension::$dateFormatter protected

TwigEnvironment::__construct

public TwigEnvironment::__construct($root, CacheBackendInterface $cache, $twig_extension_hash, \Twig_LoaderInterface $loader = NULL, $options = array()) Constructs a TwigEnvironment object and stores cache and storage internally. Parameters string $root: The app root. \Drupal\Core\Cache\CacheBackendInterface $cache: The cache bin. string $twig_extension_hash: The Twig extension hash. \Twig_LoaderInterface $loader: The Twig loader or loader chain. array $options: The options for the Twig enviro

TwigEnvironment::renderInline

public TwigEnvironment::renderInline($template_string, array $context = array()) Renders a twig string directly. Warning: You should use the render element 'inline_template' together with the #template attribute instead of this method directly. On top of that you have to ensure that the template string is not dynamic but just an ordinary static php string, because there may be installations using read-only PHPStorage that want to generate all possible twig templates as part of a build step. So

TwigEnvironment::getTemplateClass

public TwigEnvironment::getTemplateClass($name, $index = NULL) Gets the template class associated with the given string. Parameters string $name: The name for which to calculate the template class name. int $index: The index if it is an embedded template. Return value string The template class name. Overrides Twig_Environment::getTemplateClass File core/lib/Drupal/Core/Template/TwigEnvironment.php, line 79 Class TwigEnvironment A class that defines a Twig environment for Drupal. Namesp

TwigEnvironment::$templateClasses

Static cache of template classes. Type: array File core/lib/Drupal/Core/Template/TwigEnvironment.php, line 23 Class TwigEnvironment A class that defines a Twig environment for Drupal. Namespace Drupal\Core\Template Code protected $templateClasses;