Skip to content

Commit 5a98633

Browse files
kbondweaverryan
andcommitted
Apply suggestions from code review
Co-authored-by: Ryan Weaver <[email protected]>
1 parent 142b273 commit 5a98633

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/TwigComponent/src/Resources/doc/index.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ Embedded Components
654654
Embedded components were added in TwigComponents 2.2.
655655

656656
You can write your component's Twig template with blocks that can be overridden
657-
when rendering using the ``{% component %}``. These blocks can be thought of as
657+
when rendering using the ``{% component %}`` syntax. These blocks can be thought of as
658658
*slots* which you may be familiar with from Vue. The ``component`` tag is very
659659
similar to Twig's native `embed tag`_.
660660

@@ -688,14 +688,10 @@ blocks for the cells and an optional footer:
688688
{% endfor %}
689689
</tbody>
690690
</table>
691-
{% if block('footer') is defined %}
692-
<div class="data-table-footer">
693-
{{ block('footer') }}
694-
</div>
695-
{% endif %}
691+
{% block footer %}{% endblock %}
696692
</div>
697693
698-
When rendering, you can override the ``th``, ``th`` blocks and add a ``footer`` block.
694+
When rendering, you can override the ``th`` and ``td`` blocks, and also add a ``footer`` block.
699695
The ``with`` data is what's mounted on the component object.
700696

701697
.. code-block:: twig
@@ -706,7 +702,11 @@ The ``with`` data is what's mounted on the component object.
706702
{% block th %}custom th ({{ parent() }}){% endblock %}
707703
{% block td %}custom td ({{ parent() }}){% endblock %}
708704
709-
{% block footer %}My footer{% endblock %}
705+
{% block footer %}
706+
<div class="data-table-footer">
707+
My footer
708+
</div>
709+
{% endblock %}
710710
{% endcomponent %}
711711
712712
.. note::

0 commit comments

Comments
 (0)