Closed
Description
After this PR (#6096) form validation does not work.
It's bug or new validator specification ?
namespace Millwright\UserBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Table(name="user")
* @ORM\Entity
*/
class User {
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="email", type="string", length=255)
* @Assert\Email()
*/
protected $email;
...
}
in controller:
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class UserAdminController extends Controller
{
public function createAction()
{
$form = $this->createForm('user_create');
$form->bind($this->getRequest());
$result = $form->isValid();
// Always true, if email is invalid
...
}
}