LeaveProfileNode.php
Same filename in this branch
Same filename in other branches
Namespace
Drupal\sdc_other_node_visitor\Twig\ProfilerFile
-
core/
modules/ system/ tests/ modules/ sdc_other_node_visitor/ src/ Twig/ Profiler/ LeaveProfileNode.php
View source
<?php
namespace Drupal\sdc_other_node_visitor\Twig\Profiler;
use Twig\Attribute\YieldReady;
use Twig\Compiler;
use Twig\Node\Node;
/**
* Represents a profile leave node.
*/
class LeaveProfileNode extends Node {
public function __construct(string $varName) {
parent::__construct([], [
'var_name' => $varName,
]);
}
public function compile(Compiler $compiler) : void {
$compiler->write("\n")
->write(sprintf("\$%s->leave();\n\n", $this->getAttribute('var_name')));
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
LeaveProfileNode | Represents a profile leave node. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.