File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -62,23 +62,21 @@ so that the ``number()`` method is called when a user browses to it. This associ
62
62
is defined with the ``#[Route] `` attribute (in PHP, `attributes `_ are used to add
63
63
metadata to code):
64
64
65
- .. configuration-block ::
66
-
67
- .. code-block :: php-attributes
65
+ .. code-block :: diff
68
66
69
- // src/Controller/LuckyController.php
67
+ // src/Controller/LuckyController.php
70
68
71
- // ...
72
- + use Symfony\Component\Routing\Annotation\Route;
69
+ // ...
70
+ + use Symfony\Component\Routing\Annotation\Route;
73
71
74
- class LuckyController
75
- {
76
- + #[Route('/lucky/number')]
77
- public function number(): Response
78
- {
79
- // this looks exactly the same
80
- }
81
- }
72
+ class LuckyController
73
+ {
74
+ + #[Route('/lucky/number')]
75
+ public function number(): Response
76
+ {
77
+ // this looks exactly the same
78
+ }
79
+ }
82
80
83
81
That's it! If you are using Symfony web server, try it out by going to: http://localhost:8000/lucky/number
84
82
You can’t perform that action at this time.
0 commit comments