Skip to content

Commit

Permalink
Update index.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
seb-jean authored Oct 30, 2024
1 parent 2cae524 commit 4a498b0
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/Turbo/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,44 @@ a Turbo Frame, and retrieve the ID of this frame::
}
}

<twig:Turbo:Frame> Twig Component

Check failure on line 253 in src/Turbo/doc/index.rst

View workflow job for this annotation

GitHub Actions / DOCtor-RST

Please ensure title "<twig:Turbo:Frame> Twig Component" and underline length are matching
^^^^^^^^^^^^^

.. versionadded:: 2.22

The `<twig:Turbo:Frame>` Twig Component was added in Turbo 2.22.

Simple example:

.. code-block:: html+twig

<twig:Turbo:Frame id="the_frame_id" />

{# renders as: #}
<turbo-frame id="the_frame_id"></turbo-frame>

With a HTML attribute:

.. code-block:: html+twig

<twig:Turbo:Frame id="the_frame_id" loading="lazy" src="{{ path('block') }}" />

{# renders as: #}
<turbo-frame id="the_frame_id" loading="lazy" src="https://example.com/block"></turbo-frame>

With content:

.. code-block:: html+twig

<twig:Turbo:Frame id="the_frame_id" src="{{ path('block') }}">
A placeholder.
</twig:Turbo:Frame>

{# renders as: #}
<turbo-frame id="the_frame_id" src="https://example.com/block">
A placeholder.
</turbo-frame>

Writing Tests
^^^^^^^^^^^^^

Expand Down

0 comments on commit 4a498b0

Please sign in to comment.