Skip to content

Commit 3112ee9

Browse files
authored
Add docs for embedded tag
1 parent 508bef8 commit 3112ee9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/TwigComponent/doc/index.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,26 @@ should be compiled by Twig
906906

907907
// and pass object, or table, or anything you imagine
908908
<twig:Alert :foo="['col' => ['foo', 'oof']]"/>
909+
910+
This syntax came also with special syntax for embedded component
911+
912+
.. code-block:: html+twig
913+
914+
<twig:Alert message="hello" :user="user.id">
915+
<twig:block name="footer">
916+
...
917+
</twig:block>
918+
</twig:Alert>
919+
920+
And in your component template you can access your embedded block
921+
922+
.. code-block:: html+twig
923+
924+
<div class="content">
925+
{% block footer %}
926+
...
927+
{% block footer %}
928+
</div>
909929

910930
You can pass content directly inside your component.
911931

0 commit comments

Comments
 (0)