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 Nov 1, 2024
1 parent de15540 commit c160f73
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/Turbo/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,37 @@ With content:
A placeholder.
</turbo-frame>

Minimal layout for Turbo Frames
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. versionadded:: 2.22

The minimal layout for Turbo Frames was added in Turbo 2.22.

Since Turbo does not need the content outside of the frame, reducing the amount that is rendered can be a useful optimisation.

.. code-block:: html+twig

{% extends '@Turbo/frame.html.twig' %}

{% block body %}
<turbo-frame id="frame_id">
Content of the Turbo Frame
</turbo-frame>
{% endblock %}

{# renders as: #}
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<turbo-frame id="frame_id">
Content of the Turbo Frame
</turbo-frame>
</body>
</html>

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

Expand Down

0 comments on commit c160f73

Please sign in to comment.