File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -345,12 +345,12 @@ If you're using Stimulus, wrap everything in a ``<div>``:
345
345
346
346
.. code-block :: html+twig
347
347
348
- <div data-controller=" form-collection"
348
+ <div {{ stimulus_controller(' form-collection') }}
349
349
data-form-collection-index-value="{{ form.tags|length > 0 ? form.tags|last.vars.name + 1 : 0 }}"
350
350
data-form-collection-prototype-value="{{ form_widget(form.tags.vars.prototype)|e('html_attr') }}"
351
351
>
352
- <ul data- form-collection-target=" collectionContainer" ></ul>
353
- <button type="button" data-action=" form-collection# addCollectionElement" >Add a tag</button>
352
+ <ul {{ stimulus_target(' form-collection', ' collectionContainer') }} ></ul>
353
+ <button type="button" {{ stimulus_action(' form-collection', ' addCollectionElement') }} >Add a tag</button>
354
354
</div>
355
355
356
356
Then create the controller:
@@ -709,3 +709,4 @@ the relationship between the removed ``Tag`` and ``Task`` object.
709
709
.. _`@a2lix/symfony-collection` : https://github.com/a2lix/symfony-collection
710
710
.. _`symfony-collection` : https://github.com/ninsuo/symfony-collection
711
711
.. _`ArrayCollection` : https://www.doctrine-project.org/projects/doctrine-collections/en/1.6/index.html
712
+ .. _`Stimulus` : https://symfony.com/doc/current/frontend/encore/simple-example.html#stimulus-symfony-ux
You can’t perform that action at this time.
0 commit comments