File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -382,7 +382,7 @@ use the full path of the template where the macro is defined:
382
382
<twig:Alert>
383
383
{# ❌ this won't work #}
384
384
{% from _self import message_formatter %}
385
-
385
+
386
386
{# ✅ this works as expected #}
387
387
{% from 'path/of/this/template.html.twig' import message_formatter %}
388
388
@@ -1553,6 +1553,12 @@ are called additional times, the cached value is used.
1553
1553
Computed methods only work for component methods with no required
1554
1554
arguments.
1555
1555
1556
+ .. tip ::
1557
+
1558
+ Ensure to not use the ``ExposeInTemplate `` attribute on a computed method,
1559
+ otherwise the method will be called twice instead of only once, leading to
1560
+ unnecessary overhead and potential performance issues.
1561
+
1556
1562
Events
1557
1563
------
1558
1564
You can’t perform that action at this time.
0 commit comments