File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
src/TwigComponent/src/Resources/doc Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -654,7 +654,7 @@ Embedded Components
654
654
Embedded components were added in TwigComponents 2.2.
655
655
656
656
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
658
658
*slots * which you may be familiar with from Vue. The ``component `` tag is very
659
659
similar to Twig's native `embed tag `_.
660
660
@@ -688,14 +688,10 @@ blocks for the cells and an optional footer:
688
688
{% endfor %}
689
689
</tbody>
690
690
</table>
691
- {% if block('footer') is defined %}
692
- <div class="data-table-footer">
693
- {{ block('footer') }}
694
- </div>
695
- {% endif %}
691
+ {% block footer %}{% endblock %}
696
692
</div>
697
693
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.
699
695
The ``with `` data is what's mounted on the component object.
700
696
701
697
.. code-block :: twig
@@ -706,7 +702,11 @@ The ``with`` data is what's mounted on the component object.
706
702
{% block th %}custom th ({{ parent() }}){% endblock %}
707
703
{% block td %}custom td ({{ parent() }}){% endblock %}
708
704
709
- {% block footer %}My footer{% endblock %}
705
+ {% block footer %}
706
+ <div class="data-table-footer">
707
+ My footer
708
+ </div>
709
+ {% endblock %}
710
710
{% endcomponent %}
711
711
712
712
.. note ::
You can’t perform that action at this time.
0 commit comments