From f7fcea7c3a5d796e33e297c6afcae0dce47a51f2 Mon Sep 17 00:00:00 2001 From: seb-jean Date: Thu, 7 Nov 2024 19:41:53 +0100 Subject: [PATCH] Update index.rst --- src/Turbo/doc/index.rst | 47 ++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/src/Turbo/doc/index.rst b/src/Turbo/doc/index.rst index e9be71f0d3..ede325e322 100644 --- a/src/Turbo/doc/index.rst +++ b/src/Turbo/doc/index.rst @@ -297,32 +297,35 @@ Minimal layout for Turbo Frames Since Turbo does not need the content outside of the frame, reducing the amount that is rendered can be a useful optimisation. There are cases where it would be useful for Turbo to have access to items specified in ``head``. To specify the heads, you must then use a minimal layout for frame, rather than no layout. it allows you to set ``meta`` tags while still having a minimal layout. -.. code-block:: html+twig + // src/Controller/TaskController.php + namespace App\Controller; - {% extends '@Turbo/frame.html.twig' %} + // ... - {% block head %} - - {% endblock %} + class TaskController extends AbstractController + { + public function markAllAsDone(): Response + { + return $this->renderBlock('task/index.html.twig', 'mark_all_as_done'); + } + } - {% block body %} - - Content of the Turbo Frame - +.. code-block:: html+twig + + {# bottom of task/index.html.twig #} + {% block mark_all_as_done %} + + + + + + + + A placeholder. + + + {% endblock %} - - {# renders as: #} - - - - - - - - Content of the Turbo Frame - - - Writing Tests ^^^^^^^^^^^^^