From 973f9f5b8a15576c543c6afd3b928c9da91f3195 Mon Sep 17 00:00:00 2001 From: Elmas Okic Date: Fri, 20 Dec 2024 07:14:21 +0100 Subject: [PATCH] Adds the spread syntax sidenote to "Component Attribute" section --- src/TwigComponent/doc/index.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/TwigComponent/doc/index.rst b/src/TwigComponent/doc/index.rst index d933063d1e3..ddc8c993ba8 100644 --- a/src/TwigComponent/doc/index.rst +++ b/src/TwigComponent/doc/index.rst @@ -929,6 +929,10 @@ component's template: My Component! +.. note:: + + Quick reminder that passing an array of attributes to the *Component* requires the spread operator syntax (````). See `Component HTML Syntax`_. + When rendering the component, you can pass an array of html attributes to add: .. code-block:: html+twig @@ -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