Réponse

Dans User.php

Colonne
Explication

Exemple :
// src/Entity/User.php
namespace App\Entity;

// ...
use Symfony\Component\Validator\Constraints as Assert;

class User
{
/**
* @Assert\Length(
* min = 2,
* max = 50,
* minMessage = "Your first name must be at least {{ limit }} characters long",
* maxMessage = "Your first name cannot be longer than {{ limit }} characters",
* allowEmptyString = false
* )
*/
// ...
}

Question

Où se fait l'insertion Constraints as Assert pour la validation des champs d'un formulaire UserType lié à une entité ?

Thématique