diff --git a/README.md b/README.md index af677b0d..9703b522 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,9 @@ class ScriptNonceSubscriber implements EventSubscriberInterface } ``` -## Stimulus / Symfony UX Helper: stimulus_controller +## Stimulus / Symfony UX Helper + +### stimulus_controller This bundle also ships with a special `stimulus_controller()` Twig function that can be used to render [Stimulus Controllers & Values](https://stimulus.hotwire.dev/reference/values). @@ -238,4 +240,64 @@ associative array in the first argument: ``` +### stimulus_action + +The `stimulus_action()` Twig function can be used to render [Stimulus Actions](https://stimulus.hotwire.dev/reference/actions). + +For example: +```twig +
Hello
+
Hello
+ + +
Hello
+
Hello
+``` + +If you have multiple actions and/or methods on the same element, pass them all as an +associative array in the first argument: +```twig +
+ Hello +
+ + +
+ Hello +
+``` + +### stimulus_target + +The `stimulus_target()` Twig function can be used to render [Stimulus Targets](https://stimulus.hotwire.dev/reference/targets). + +For example: +```twig +
Hello
+
Hello
+ + +
Hello
+
Hello
+``` + +If you have multiple targets on the same element, pass them all as an +associative array in the first argument: +```twig +
+ Hello +
+ + +
+ Hello +
+``` + Ok, have fun!