File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -122,18 +122,21 @@ inside your controller::
122122 use Symfony\Component\HttpFoundation\Response;
123123 use Symfony\Component\Routing\Annotation\Route;
124124
125- /**
126- * @Route("/products/new")
127- */
128- public function new(MessageGenerator $messageGenerator): Response
125+ class ProductController
129126 {
130- // thanks to the type-hint, the container will instantiate a
131- // new MessageGenerator and pass it to you!
132- // ...
127+ /**
128+ * @Route("/products/new")
129+ */
130+ public function new(MessageGenerator $messageGenerator): Response
131+ {
132+ // thanks to the type-hint, the container will instantiate a
133+ // new MessageGenerator and pass it to you!
134+ // ...
133135
134- $message = $messageGenerator->getHappyMessage();
135- $this->addFlash('success', $message);
136- // ...
136+ $message = $messageGenerator->getHappyMessage();
137+ $this->addFlash('success', $message);
138+ // ...
139+ }
137140 }
138141
139142When you ask for the ``MessageGenerator `` service, the container constructs a new
You can’t perform that action at this time.
0 commit comments