File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -906,9 +906,11 @@ the component you're now rendering *and* you have access to all of that componen
906
906
{{ this.someFunction }} {# this refers to SuccessAlert #}
907
907
908
908
{% component Alert with { type: 'success' } %}
909
- {{ this.someFunction }} {# this refers to Alert! #}
909
+ {% block content %}
910
+ {{ this.someFunction }} {# this refers to Alert! #}
910
911
911
- {{ type }} {# references a "type" prop from Alert #}
912
+ {{ type }} {# references a "type" prop from Alert #}
913
+ {% endblock %}
912
914
{% endcomponent %}
913
915
914
916
Conveniently, in addition to the variables from the ``Alert `` component, you still have
@@ -919,7 +921,9 @@ access to whatever variables are available in the original template:
919
921
{# templates/SuccessAlert.html.twig #}
920
922
{% set name = 'Fabien' %}
921
923
{% component Alert with { type: 'success' } %}
922
- Hello {{ name }}
924
+ {% block content %}
925
+ Hello {{ name }}
926
+ {% endblock %}
923
927
{% endcomponent %}
924
928
925
929
Note that ALL variables from upper components (e.g. ``SuccessAlert ``) are available to lower
You can’t perform that action at this time.
0 commit comments