Skip to content

Commit

Permalink
Adds the spread syntax sidenote to "Component Attribute" section
Browse files Browse the repository at this point in the history
  • Loading branch information
eokic committed Dec 20, 2024
1 parent dec3eb3 commit 973f9f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/TwigComponent/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,10 @@ component's template:
My Component!
</div>

.. note::

Quick reminder that passing an array of attributes to the *Component* requires the spread operator syntax (``<twig:MyComponent {{ ...attributes }} />``). See `Component HTML Syntax`_.

When rendering the component, you can pass an array of html attributes to add:

.. code-block:: html+twig
Expand Down Expand Up @@ -1796,6 +1800,7 @@ https://symfony.com/doc/current/contributing/code/bc.html
.. _`Live Components`: https://symfony.com/bundles/ux-live-component/current/index.html
.. _`live component`: https://symfony.com/bundles/ux-live-component/current/index.html
.. _`Vue`: https://v3.vuejs.org/guide/computed.html
.. _`Component HTML Syntax`: https://symfony.com/bundles/ux-live-component/current/index.html#component-html-syntax
.. _`Live Nested Components`: https://symfony.com/bundles/ux-live-component/current/index.html#nested-components
.. _`Passing Blocks to Live Components`: https://symfony.com/bundles/ux-live-component/current/index.html#passing-blocks
.. _`Stimulus controller`: https://symfony.com/bundles/StimulusBundle/current/index.html
Expand Down

0 comments on commit 973f9f5

Please sign in to comment.