Skip to content

Commit

Permalink
[Site] Fix Turbo demos
Browse files Browse the repository at this point in the history
To be merge once symfony#1929 is merged
  • Loading branch information
smnandre committed Jun 22, 2024
1 parent fed00e2 commit a43b5bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions ux.symfony.com/src/Controller/UxPackage/TurboController.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,19 @@ public function turboChat(Request $request, HubInterface $hub, ChatRepository $c
}

#[Route('/turbo/todos', name: 'app_turbo_todo_list')]
public function turboTodoList(Request $request): Response
public function turboTodoList(UxPackageRepository $packageRepository, Request $request): Response
{
$session = $request->getSession();
$this->initializeTodos($session);

return $this->render('ux_packages/turbo/todos.html.twig', [
'package' => $packageRepository->find('turbo'),
'todos' => $session->get('todos'),
]);
}

#[Route('/turbo/todos/add', name: 'app_turbo_add_todo_item')]
public function turboAddTodoItem(Request $request): Response
public function turboAddTodoItem(UxPackageRepository $packageRepository, Request $request): Response
{
$session = $request->getSession();
$this->initializeTodos($session);
Expand All @@ -121,6 +122,7 @@ public function turboAddTodoItem(Request $request): Response
}

return $this->render('ux_packages/turbo/add_todo.html.twig', [
'package' => $packageRepository->find('turbo'),
'form' => $form,
]);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'base.html.twig' %}
{% extends 'ux_packages/package.html.twig' %}

{% block body %}
<h1>Add a TODO Item</h1>
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/ux_packages/turbo/todos.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'base.html.twig' %}
{% extends 'ux_packages/package.html.twig' %}

{% block body %}
<h1>Today's TODO List!</h1>
Expand Down

0 comments on commit a43b5bc

Please sign in to comment.