diff --git a/src/Bridges/FormsLatte/FormsExtension.php b/src/Bridges/FormsLatte/FormsExtension.php index e481544cc..3e13a0b88 100644 --- a/src/Bridges/FormsLatte/FormsExtension.php +++ b/src/Bridges/FormsLatte/FormsExtension.php @@ -28,7 +28,9 @@ public function getTags(): array 'inputError' => [Nodes\InputErrorNode::class, 'create'], 'formPrint' => [Nodes\FormPrintNode::class, 'create'], 'formClassPrint' => [Nodes\FormPrintNode::class, 'create'], - 'n:name' => [Nodes\NNameNode::class, 'create'], + 'n:name' => fn(Latte\Compiler\Tag $tag) => yield from strtolower($tag->htmlElement->name) === 'form' + ? Nodes\FormNNameNode::create($tag) + : Nodes\FieldNNameNode::create($tag), ]; } diff --git a/src/Bridges/FormsLatte/Nodes/NNameNode.php b/src/Bridges/FormsLatte/Nodes/FieldNNameNode.php similarity index 69% rename from src/Bridges/FormsLatte/Nodes/NNameNode.php rename to src/Bridges/FormsLatte/Nodes/FieldNNameNode.php index 5a6867bae..78ce293a6 100644 --- a/src/Bridges/FormsLatte/Nodes/NNameNode.php +++ b/src/Bridges/FormsLatte/Nodes/FieldNNameNode.php @@ -9,7 +9,6 @@ namespace Nette\Bridges\FormsLatte\Nodes; -use Latte; use Latte\Compiler\Nodes\AreaNode; use Latte\Compiler\Nodes\AuxiliaryNode; use Latte\Compiler\Nodes\Html\AttributeNode; @@ -24,9 +23,9 @@ /** - *