ValidatorExtension example

use Symfony\Component\Form\Forms as SymfonyForms;
use Symfony\Component\Validator\Validator\ValidatorInterface;

class FormFactory
{
    /** * @return FormFactoryInterface */
    public static function factory(ValidatorInterface $validator, DependencyInjectionExtension $dependencyInjectionExtension)
    {
        return SymfonyForms::createFormFactoryBuilder()
            ->addExtension(new ValidatorExtension($validator))
            ->addExtension($dependencyInjectionExtension)
            ->getFormFactory();
    }
}
Home | Imprint | This part of the site doesn't use cookies.