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::
122
122
use Symfony\Component\HttpFoundation\Response;
123
123
use Symfony\Component\Routing\Annotation\Route;
124
124
125
- /**
126
- * @Route("/products/new")
127
- */
128
- public function new(MessageGenerator $messageGenerator): Response
125
+ class ProductController
129
126
{
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
+ // ...
133
135
134
- $message = $messageGenerator->getHappyMessage();
135
- $this->addFlash('success', $message);
136
- // ...
136
+ $message = $messageGenerator->getHappyMessage();
137
+ $this->addFlash('success', $message);
138
+ // ...
139
+ }
137
140
}
138
141
139
142
When you ask for the ``MessageGenerator `` service, the container constructs a new
You can’t perform that action at this time.
0 commit comments