File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,29 @@ Use any HTML element as a Twig Component:
5454<twig:Input type="email" name="email" required />
5555```
5656
57+ ### Use in anonymous Twig Components
58+ ``` twig
59+ {# templates/components/Teaser.html.twig #}
60+ <twig:Div class="teaser">
61+ <twig:H3>{{ headline }}</twig:H3>
62+ <twig:P>{{ content }}</twig:P>
63+ <twig:A role="button" href="{{ buttonLink }}" title="{{ buttonText }}">{{ buttonText }}</twig:A>
64+ </twig:Div>
65+ ```
66+
67+ which can then be used in pages:
68+ ``` twig
69+ {# templates/page.html.twig #}
70+ {% for item in teasers %}
71+ <twig:Teaser
72+ headline="{{ item.headline }}"
73+ content="{{ item.content }}"
74+ buttonLink="{{ item.buttonLink }}"
75+ buttonText="{{ item.buttonText }}">
76+ </twig:Teaser>
77+ {% endfor %}
78+ ```
79+
5780## Features
5881
5982- ✅ All HTML5 elements supported
You can’t perform that action at this time.
0 commit comments