'Trinity\Bundle\NotificationBundle\Model\Template', 'name' => 'template', ); /** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add( 'reference', 'text', array( 'required' => true, 'constraints' => array( new NotBlank(), ), ) ); $builder->add( 'description', 'textarea', array( 'required' => true, 'constraints' => array( new NotBlank(), ), ) ); if (isset($options['use_ace_editor']) && $options['use_ace_editor'] === true) { $builder->add( 'content', 'ace_editor', array( 'wrapper_attr' => array(), // aceeditor wrapper html attributes. 'width' => '100%', 'height' => 750, 'font_size' => 12, 'mode' => 'ace/mode/twig', 'theme' => 'ace/theme/vibrant_ink', 'tab_size' => null, 'read_only' => false, 'use_soft_tabs' => false, 'use_wrap_mode' => false, 'show_print_margin' => null, 'highlight_active_line' => false, 'required' => true, 'constraints' => array( new NotBlank(), ), ) ); $builder->add( 'logContent', 'ace_editor', array( 'wrapper_attr' => array(), // aceeditor wrapper html attributes. 'width' => '100%', 'height' => 150, 'font_size' => 12, 'mode' => 'ace/mode/twig', 'theme' => 'ace/theme/vibrant_ink', 'tab_size' => null, 'read_only' => false, 'use_soft_tabs' => false, 'use_wrap_mode' => false, 'show_print_margin' => null, 'highlight_active_line' => false, 'required' => true, 'constraints' => array( new NotBlank(), ), ) ); } else { $builder->add( 'content', 'textarea', array( 'required' => true, 'constraints' => array( new NotBlank(), ), ) ); $builder->add( 'logContent', 'textarea', array( 'required' => true, 'constraints' => array( new NotBlank(), ), ) ); } } }