add( 'name', 'text', array( 'required' => true, 'constraints' => array( new NotBlank(), ), ) ); $builder->add( 'title', 'text', array( 'required' => true, 'constraints' => array( new NotBlank(), ), ) ); $builder->add( 'culture', 'text', array( 'required' => true, 'constraints' => array( new NotBlank(), ), ) ); $builder->add( 'domain', 'text', array( 'required' => true, 'attr' => array( 'data-help' => "Regex available, eg: regex:/.*\\.example.com/s", ), 'constraints' => array( new NotBlank(), ), ) ); } /** * {@inheritdoc} */ public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( 'data_class' => 'Trinity\Bundle\ContentManagerBundle\Model\Nav', )); } /** * {@inheritdoc} */ public function getName() { return 'nav'; } }