Skip to content

Commit ecc50c5

Browse files
committed
NAssetNode: compatible with Latte 3.1
1 parent 790f42e commit ecc50c5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Bridges/AssetsLatte/Nodes/NAssetNode.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Latte\Compiler\Nodes\AuxiliaryNode;
1515
use Latte\Compiler\Nodes\Html\AttributeNode;
1616
use Latte\Compiler\Nodes\Html\ElementNode;
17+
use Latte\Compiler\Nodes\Html\ExpressionAttributeNode;
1718
use Latte\Compiler\Nodes\Php\Expression\ArrayNode;
1819
use Latte\Compiler\Nodes\Php\ExpressionNode;
1920
use Latte\Compiler\Nodes\StatementNode;
@@ -89,6 +90,8 @@ public static function findUsedAttributes(ElementNode $el): array
8990
foreach ($el->attributes?->children as $child) {
9091
if ($child instanceof AttributeNode && $child->name instanceof TextNode) {
9192
$res[$child->name->content] = NodeHelpers::toText($child->value) ?? true;
93+
} elseif ($child instanceof ExpressionAttributeNode) {
94+
$res[$child->name] = true;
9295
}
9396
}
9497
return $res;

0 commit comments

Comments
 (0)