Routing and controllers

← Routing and controllers

Ashterix

docs(articles): Magento and Symfony examples side by side, request lifecycle as a Mermaid diagram

en/articles/magento-to-symfony/core/routing.md +6 −1

1 1 # Routing and controllers
2 2
3 + ::::columns
4 + :::col
3 5 **Magento** · routes.xml + Controller/Question/View.php
4 6
5 7 ```xml
28 30 }
29 31 }
30 32 ```
31 −
33 + :::
34 + :::col
32 35 **Symfony** · src/Controller/FaqController.php
33 36
34 37 ```php
53 56 }
54 57 }
55 58 ```
59 + :::
60 + ::::
56 61
57 62 - The entity is resolved from the route parameter; if it doesn't exist, you get a 404 without writing any code. For `{id}` you don't need the `#[MapEntity]` attribute.
58 63 - You can request services directly in action arguments, not only in the constructor.