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 @@ -125,18 +125,21 @@ inside your controller::
125
125
use Symfony\Component\HttpFoundation\Response;
126
126
use Symfony\Component\Routing\Annotation\Route;
127
127
128
- /**
129
- * @Route("/products/new")
130
- */
131
- public function new(MessageGenerator $messageGenerator): Response
128
+ class ProductController
132
129
{
133
- // thanks to the type-hint, the container will instantiate a
134
- // new MessageGenerator and pass it to you!
135
- // ...
130
+ /**
131
+ * @Route("/products/new")
132
+ */
133
+ public function new(MessageGenerator $messageGenerator): Response
134
+ {
135
+ // thanks to the type-hint, the container will instantiate a
136
+ // new MessageGenerator and pass it to you!
137
+ // ...
136
138
137
- $message = $messageGenerator->getHappyMessage();
138
- $this->addFlash('success', $message);
139
- // ...
139
+ $message = $messageGenerator->getHappyMessage();
140
+ $this->addFlash('success', $message);
141
+ // ...
142
+ }
140
143
}
141
144
142
145
When you ask for the ``MessageGenerator `` service, the container constructs a new
You can’t perform that action at this time.
0 commit comments