Skip to content

[TwigComponent][LiveComponent] clarify excluding this for public props #244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/LiveComponent/src/Resources/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ A real-time product search component might look like this::
}
}

.. versionadded:: 2.1

The ability to reference local variables in the template (e.g. ``query``) was added in TwigComponents 2.1.
Previously, all data needed to be referenced through ``this`` (e.g. ``this.query``).

.. code-block:: twig

{# templates/components/product_search.html.twig #}
Expand Down
5 changes: 5 additions & 0 deletions src/TwigComponent/src/Resources/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ In the template, the ``AlertComponent`` instance is available via
the ``this`` variable and public properties are available directly.
Use them to render the two new properties:

.. versionadded:: 2.1

The ability to reference local variables in the template (e.g. ``message``) was added in TwigComponents 2.1.
Previously, all data needed to be referenced through ``this`` (e.g. ``this.message``).

.. code-block:: twig

<div class="alert alert-{{ type }}">
Expand Down