@@ -337,32 +337,32 @@ For example:
337337
338338.. code-block :: html+twig
339339
340- <div {{ stimulus_target('controller', 'a-target ') }}>Hello</div>
341- <div {{ stimulus_target('controller', 'a-target second-target ') }}>Hello</div>
340+ <div {{ stimulus_target('controller', 'myTarget ') }}>Hello</div>
341+ <div {{ stimulus_target('controller', 'myTarget secondTarget ') }}>Hello</div>
342342
343343 <!-- would render -->
344- <div data-controller-target="a-target ">Hello</div>
345- <div data-controller-target="a-target second-target ">Hello</div>
344+ <div data-controller-target="myTarget ">Hello</div>
345+ <div data-controller-target="myTarget secondTarget ">Hello</div>
346346
347347If you have multiple targets on the same element, you can chain them as there's
348348also a ``stimulus_target `` filter:
349349
350350.. code-block :: html+twig
351351
352- <div {{ stimulus_target('controller', 'a-target ')|stimulus_target('other-controller', 'another-target ') }}>
352+ <div {{ stimulus_target('controller', 'myTarget ')|stimulus_target('other-controller', 'anotherTarget ') }}>
353353 Hello
354354 </div>
355355
356356 <!-- would render -->
357- <div data-controller-target="a-target " data-other-controller-target="another-target ">
357+ <div data-controller-target="myTarget " data-other-controller-target="anotherTarget ">
358358 Hello
359359 </div>
360360
361361You can also retrieve the generated attributes as an array, which can be helpful e.g. for forms:
362362
363363.. code-block :: twig
364364
365- {{ form_row(form.password, { attr: stimulus_target('hello-controller', 'a-target ').toArray() }) }}
365+ {{ form_row(form.password, { attr: stimulus_target('hello-controller', 'myTarget ').toArray() }) }}
366366
367367 .. _configuration :
368368
0 commit comments