class TwigSimpleCheckToStringNode
Same name in other branches
- 11.x core/lib/Drupal/Core/Template/TwigSimpleCheckToStringNode.php \Drupal\Core\Template\TwigSimpleCheckToStringNode
Defines a twig node for simplifying CheckToStringNode.
Drupal's sandbox policy is very permissive with checking whether an object can be converted to a string. We allow any object with a __toString method. This means that the array traversal in the default SandboxExtension implementation added by the parent class is a performance overhead we don't need.
Hierarchy
- class \Drupal\Core\Template\TwigSimpleCheckToStringNode extends \Twig\Node\CheckToStringNode
Expanded class hierarchy of TwigSimpleCheckToStringNode
See also
\Drupal\Core\Template\TwigSandboxPolicy
\Drupal\Core\Template\RemoveCheckToStringNodeVisitor
File
-
core/
lib/ Drupal/ Core/ Template/ TwigSimpleCheckToStringNode.php, line 22
Namespace
Drupal\Core\TemplateView source
final class TwigSimpleCheckToStringNode extends CheckToStringNode {
/**
* {@inheritdoc}
*/
public function compile(Compiler $compiler) : void {
$expr = $this->getNode('expr');
$compiler->subcompile($expr);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.