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.
2 parents 0278c62 + d1b4f9c commit d19ade7Copy full SHA for d19ade7
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