Hi,

I'm trying Symfony2 and I have a problem with validate feature. When i
have the following code in my controller :

    public function newAction()
    {
        $validator = $this->container->get('validator');
        $author = new Author();

        print $validator->validate($author);
        //return $this->render('ProjectBundle:Project:author.php');
    }

And the this one in my Entity :

class Author
{
    public $name;

    public static function loadMetadata(ClassMetadata $metadata)
    {
        echo 'test';
        $metadata->addPropertyConstraint('name', new NotBlank());
        $metadata->addPropertyConstraint('name', new MinLength(300));
    }
}

The validation pass with success while the name property is empty.

Could you help me please.

PS : The validation service in config.php is at true.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to