Пример #1
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $season = $this->blockInstance->getTimetable()->getLineConfig()->getSeason();
     $calendars = $this->calendarManager->getCalendarsForRoute($this->externalCoverageId, $this->blockInstance->getTimetable()->getExternalRouteId(), $season->getStartDate(), $season->getEndDate());
     $this->choices = $this->getChoices($calendars);
     $builder->add('title', 'text', array('label' => 'block.calendar.labels.title'))->add('content', 'choice', array('choices' => $this->choices, 'disabled' => $this->isDisabled(), 'label' => 'block.calendar.labels.content', 'attr' => array('data-fill-title' => true), 'constraints' => array(new NotBlank())));
     parent::buildForm($builder, $options);
 }
Пример #2
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('title', 'text', array('label' => 'block.img.labels.title', 'required' => false))->add('content', 'file', array('data_class' => null, 'constraints' => array(new File(array('mimeTypes' => array(self::MIME_IMAGETYPE_PNG, self::MIME_IMAGETYPE_JPEG))), new NotBlank()), 'label' => 'block.img.labels.content'));
     parent::buildForm($builder, $options);
 }
Пример #3
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('title', 'text', array('label' => 'block.text.labels.title', 'required' => false))->add('content', 'textarea', array('attr' => array('rows' => 5), 'label' => 'block.text.labels.content', 'required' => false));
     parent::buildForm($builder, $options);
 }