function TwigNodeTrans::__construct

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Template/TwigNodeTrans.php \Drupal\Core\Template\TwigNodeTrans::__construct()
  2. 8.9.x core/lib/Drupal/Core/Template/TwigNodeTrans.php \Drupal\Core\Template\TwigNodeTrans::__construct()
  3. 10 core/lib/Drupal/Core/Template/TwigNodeTrans.php \Drupal\Core\Template\TwigNodeTrans::__construct()

File

core/lib/Drupal/Core/Template/TwigNodeTrans.php, line 35

Class

TwigNodeTrans
A class that defines the Twig 'trans' tag for Drupal.

Namespace

Drupal\Core\Template

Code

public function __construct(Node $body, ?Node $plural = NULL, ?AbstractExpression $count = NULL, ?AbstractExpression $options = NULL, $lineno = 0, $tag = NULL) {
    $nodes['body'] = $body;
    if ($count !== NULL) {
        $nodes['count'] = $count;
    }
    if ($plural !== NULL) {
        $nodes['plural'] = $plural;
    }
    if ($options !== NULL) {
        $nodes['options'] = $options;
    }
    parent::__construct($nodes, [], $lineno, $tag);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.