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 481b1b2 commit 5528173Copy full SHA for 5528173
forms.rst
@@ -507,6 +507,23 @@ object.
507
protected $dueDate;
508
}
509
510
+ .. code-block:: php-attributes
511
+
512
+ // src/Entity/Task.php
513
+ namespace App\Entity;
514
515
+ use Symfony\Component\Validator\Constraints as Assert;
516
517
+ class Task
518
+ {
519
+ #[Assert\NotBlank]
520
+ public $task;
521
522
523
+ #[Assert\Type(\DateTime::class)]
524
+ protected $dueDate;
525
+ }
526
527
.. code-block:: yaml
528
529
# config/validator/validation.yaml
0 commit comments