|
6 | 6 | use Symfony\Component\HttpFoundation\Response; |
7 | 7 | use Symfony\Component\Routing\Attribute\Route; |
8 | 8 |
|
9 | | -#[Route('/ux-live-component')] |
| 9 | +#[Route('/ux-live-component', name: 'app_ux_live_component_')] |
10 | 10 | final class LiveComponentController extends AbstractController |
11 | 11 | { |
12 | | - #[Route('/')] |
13 | | - public function index(): Response |
| 12 | + #[Route('/counter', name: 'counter')] |
| 13 | + public function counter(): Response |
14 | 14 | { |
15 | | - return $this->render('ux_live_component/index.html.twig', [ |
16 | | - 'controller_name' => 'LiveComponentController', |
| 15 | + return $this->render('ux_live_component/counter.html.twig'); |
| 16 | + } |
| 17 | + |
| 18 | + #[Route('/registration-form', name: 'registration_form')] |
| 19 | + public function registrationForm(): Response |
| 20 | + { |
| 21 | + return $this->render('ux_live_component/registration_form.html.twig'); |
| 22 | + } |
| 23 | + |
| 24 | + #[Route('/fruits/{page?1}', name: 'fruits')] |
| 25 | + public function fruits(int $page): Response |
| 26 | + { |
| 27 | + return $this->render('ux_live_component/fruits.html.twig', [ |
| 28 | + 'page' => $page, |
17 | 29 | ]); |
18 | 30 | } |
| 31 | + |
| 32 | + #[Route('/with-dto', name: 'with_dto')] |
| 33 | + public function withDto(): Response |
| 34 | + { |
| 35 | + return $this->render('ux_live_component/with_dto.html.twig'); |
| 36 | + } |
| 37 | + |
| 38 | + #[Route('/with-dto-collection', name: 'with_dto_collection')] |
| 39 | + public function withDtoCollection(): Response |
| 40 | + { |
| 41 | + return $this->render('ux_live_component/with_dto_collection.html.twig'); |
| 42 | + } |
| 43 | + |
| 44 | + #[Route('/with-dto-and-serializer', name: 'with_dto_and_serializer')] |
| 45 | + public function withDtoAndSerializer(): Response |
| 46 | + { |
| 47 | + return $this->render('ux_live_component/with_dto_and_serializer.html.twig'); |
| 48 | + } |
| 49 | + |
| 50 | + #[Route('/with-dto-and-custom-hydration-methods', name: 'with_dto_and_custom_hydration_methods')] |
| 51 | + public function withDtoAndCustomHydrationMethods(): Response |
| 52 | + { |
| 53 | + return $this->render('ux_live_component/with_dto_and_custom_hydration_methods.html.twig'); |
| 54 | + } |
| 55 | + |
| 56 | + #[Route('/with-dto-and-hydration-extension', name: 'with_dto_and_hydration_extension')] |
| 57 | + public function withDtoAndHydrationExtension(): Response |
| 58 | + { |
| 59 | + return $this->render('ux_live_component/with_dto_and_hydration_extension.html.twig'); |
| 60 | + } |
| 61 | + |
| 62 | + #[Route('/item-list', name: 'item_list')] |
| 63 | + public function itemList(): Response |
| 64 | + { |
| 65 | + return $this->render('ux_live_component/item_list.html.twig'); |
| 66 | + } |
| 67 | + |
| 68 | + #[Route('/with-aliased-live-props', name: 'with_aliased_live_props')] |
| 69 | + public function withAliasedLiveProps(): Response |
| 70 | + { |
| 71 | + return $this->render('ux_live_component/with_aliased_live_props.html.twig'); |
| 72 | + } |
19 | 73 | } |
0 commit comments