Skip to content

Commit 1bdfd69

Browse files
As requested :-)
1 parent abd9675 commit 1bdfd69

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

form/form_collections.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,12 @@ If you're using Stimulus, wrap everything in a ``<div>``:
345345

346346
.. code-block:: html+twig
347347

348-
<div data-controller="form-collection"
348+
<div {{ stimulus_controller('form-collection') }}
349349
data-form-collection-index-value="{{ form.tags|length > 0 ? form.tags|last.vars.name + 1 : 0 }}"
350350
data-form-collection-prototype-value="{{ form_widget(form.tags.vars.prototype)|e('html_attr') }}"
351351
>
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>
354354
</div>
355355

356356
Then create the controller:
@@ -709,3 +709,4 @@ the relationship between the removed ``Tag`` and ``Task`` object.
709709
.. _`@a2lix/symfony-collection`: https://github.com/a2lix/symfony-collection
710710
.. _`symfony-collection`: https://github.com/ninsuo/symfony-collection
711711
.. _`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

0 commit comments

Comments
 (0)