File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1025,14 +1025,14 @@ Extract specific attributes and discard the rest:
1025
1025
1026
1026
.. code-block :: html+twig
1027
1027
1028
+ {# render component #}
1029
+ {{ component('MyComponent', { class: 'foo', style: 'color:red' }) }}
1030
+
1028
1031
{# templates/components/MyComponent.html.twig #}
1029
1032
<div{{ attributes.only('class') }}>
1030
1033
My Component!
1031
1034
</div>
1032
1035
1033
- {# render component #}
1034
- {{ component('MyComponent', { class: 'foo', style: 'color:red' }) }}
1035
-
1036
1036
{# renders as: #}
1037
1037
<div class="foo">
1038
1038
My Component!
@@ -1045,14 +1045,14 @@ Exclude specific attributes:
1045
1045
1046
1046
.. code-block :: html+twig
1047
1047
1048
+ {# render component #}
1049
+ {{ component('MyComponent', { class: 'foo', style: 'color:red' }) }}
1050
+
1048
1051
{# templates/components/MyComponent.html.twig #}
1049
1052
<div{{ attributes.without('class') }}>
1050
1053
My Component!
1051
1054
</div>
1052
1055
1053
- {# render component #}
1054
- {{ component('MyComponent', { class: 'foo', style: 'color:red' }) }}
1055
-
1056
1056
{# renders as: #}
1057
1057
<div style="color:red">
1058
1058
My Component!
You can’t perform that action at this time.
0 commit comments