Skip to content

Commit 9056438

Browse files
committed
minor #244 [TwigComponent][LiveComponent] clarify excluding this for public props (kbond)
This PR was merged into the 2.x branch. Discussion ---------- [TwigComponent][LiveComponent] clarify excluding this for public props | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Tickets | Fix #242 | License | MIT Commits ------- 69207a0 [TwigComponent][LiveComponent] clarify excluding this for public props
2 parents 303c82f + 69207a0 commit 9056438

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/LiveComponent/src/Resources/doc/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ A real-time product search component might look like this::
3838
}
3939
}
4040

41+
.. versionadded:: 2.1
42+
43+
The ability to reference local variables in the template (e.g. ``query``) was added in TwigComponents 2.1.
44+
Previously, all data needed to be referenced through ``this`` (e.g. ``this.query``).
45+
4146
.. code-block:: twig
4247
4348
{# templates/components/product_search.html.twig #}

src/TwigComponent/src/Resources/doc/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ In the template, the ``AlertComponent`` instance is available via
134134
the ``this`` variable and public properties are available directly.
135135
Use them to render the two new properties:
136136

137+
.. versionadded:: 2.1
138+
139+
The ability to reference local variables in the template (e.g. ``message``) was added in TwigComponents 2.1.
140+
Previously, all data needed to be referenced through ``this`` (e.g. ``this.message``).
141+
137142
.. code-block:: twig
138143
139144
<div class="alert alert-{{ type }}">

0 commit comments

Comments
 (0)