We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 600f5ae commit d1b4f9cCopy full SHA for d1b4f9c
validation.rst
@@ -129,16 +129,16 @@ returned. Take this simple example from inside a controller::
129
130
// ...
131
use Symfony\Component\HttpFoundation\Response;
132
+ use Symfony\Component\Validator\Validator\ValidatorInterface;
133
use App\Entity\Author;
134
135
- public function author()
136
+ public function author(ValidatorInterface $validator)
137
{
138
$author = new Author();
139
140
// ... do something to the $author object
141
- $validator = $this->get('validator');
142
$errors = $validator->validate($author);
143
144
if (count($errors) > 0) {
0 commit comments