Skip to content

Commit

Permalink
Component attributes on stempler (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
adikalon authored Apr 16, 2024
1 parent bd9d382 commit 06b0d98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Bootloader/ValidationBootloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private function initSymfonyValidator(
FactoryInterface $factory
): SymfonyValidator {
$validator = \Symfony\Component\Validator\Validation::createValidatorBuilder()
->enableAnnotationMapping()
->enableAttributeMapping()
->setConstraintValidatorFactory($constraintValidatorFactory);

if ($container->has(TranslatorInterface::class)) {
Expand Down
4 changes: 3 additions & 1 deletion src/Template/Stempler/NodeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ public function enterNode(mixed $node, VisitorContext $ctx): mixed

return $c;
}

return $node;
}

return $node;
return null;
}

public function leaveNode(mixed $node, VisitorContext $ctx): mixed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div>
<div style="text-align: center">
<button wire:click="increment">+</button>
<h1>{{ $count }}</h1>
</div>

0 comments on commit 06b0d98

Please sign in to comment.