Typed Data API

API for describing data based on a set of available data types. PHP has data types, such as int, string, float, array, etc., and it is an object-oriented language that lets you define classes and interfaces. However, in some cases, it is useful to be able to define an abstract type (as in an interface, free of implementation details), that still has properties (which an interface cannot) as well as meta-data. The Typed Data API provides this abstraction. Overview Each data type in the Typed Dat

twig_without

twig_without($element) Removes child elements from a copy of the original array. Creates a copy of the renderable array and removes child elements by key specified through filter's arguments. The copy can be printed without these elements. The original renderable array is still available and can be used to print child elements in their entirety in the twig template. Parameters array|object $element: The parent renderable array to exclude the child items. string[] $args, ...: The string keys of

twig_theme

twig_theme($existing, $type, $theme, $path) Implements hook_theme(). File core/themes/engines/twig/twig.engine, line 15 Handles integration of Twig templates with the Drupal theme system. Code function twig_theme($existing, $type, $theme, $path) { $templates = drupal_find_theme_functions($existing, array($theme)); $templates += drupal_find_theme_templates($existing, '.html.twig', $path); return $templates; }

TwigTransTokenParser::getTag

public TwigTransTokenParser::getTag() File core/lib/Drupal/Core/Template/TwigTransTokenParser.php, line 72 Class TwigTransTokenParser A class that defines the Twig 'trans' token parser for Drupal. Namespace Drupal\Core\Template Code public function getTag() { return 'trans'; }

TwigTransTokenParser::parse

public TwigTransTokenParser::parse(\Twig_Token $token) File core/lib/Drupal/Core/Template/TwigTransTokenParser.php, line 21 Class TwigTransTokenParser A class that defines the Twig 'trans' token parser for Drupal. Namespace Drupal\Core\Template Code public function parse(\Twig_Token $token) { $lineno = $token->getLine(); $stream = $this->parser->getStream(); $body = NULL; $options = NULL; $count = NULL; $plural = NULL; if (!$stream->test(\Twig_Token::BLOCK_EN

TwigTransTokenParser::decideForEnd

public TwigTransTokenParser::decideForEnd($token) Detect the end of a 'trans' tag. File core/lib/Drupal/Core/Template/TwigTransTokenParser.php, line 65 Class TwigTransTokenParser A class that defines the Twig 'trans' token parser for Drupal. Namespace Drupal\Core\Template Code public function decideForEnd($token) { return $token->test('endtrans'); }

twig_extension

twig_extension() Implements hook_extension(). File core/themes/engines/twig/twig.engine, line 24 Handles integration of Twig templates with the Drupal theme system. Code function twig_extension() { return '.html.twig'; }

twig_render_template

twig_render_template($template_file, array $variables) Implements hook_render_template(). Renders a Twig template. If the Twig debug setting is enabled, HTML comments including the theme hook and template file name suggestions will surround the template markup. Parameters string $template_file: The file name of the template to render. array $variables: A keyed array of variables that will appear in the output. Return value string|\Drupal\Component\Render\MarkupInterface The output generated b

TwigTransTokenParser::decideForFork

public TwigTransTokenParser::decideForFork($token) Detect a 'plural' switch or the end of a 'trans' tag. File core/lib/Drupal/Core/Template/TwigTransTokenParser.php, line 58 Class TwigTransTokenParser A class that defines the Twig 'trans' token parser for Drupal. Namespace Drupal\Core\Template Code public function decideForFork($token) { return $token->test(array('plural', 'endtrans')); }

TwigSandboxPolicy::checkSecurity

public TwigSandboxPolicy::checkSecurity($tags, $filters, $functions) Overrides Twig_Sandbox_SecurityPolicyInterface::checkSecurity File core/lib/Drupal/Core/Template/TwigSandboxPolicy.php, line 69 Class TwigSandboxPolicy Default sandbox policy for Twig templates. Namespace Drupal\Core\Template Code public function checkSecurity($tags, $filters, $functions) { }