Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function isSubmitted(FormInterface $form)
 {
     $hasAttribute = $this->request->request->has(sprintf('%s_submitted', $form->getName()));
     $isValidMethod = $this->request->isMethod($form->getOption('method'));
     return $hasAttribute && $isValidMethod;
 }
Ejemplo n.º 2
0
 /**
  * Dispatches resource event
  *
  * @param object $resource
  * @param string $name
  */
 protected function dispatchFormEvent(FormBuilderInterface $builder, FormInterface $form, $name)
 {
     $eventName = sprintf('%s.%s', $form->getName(), $name);
     $event = new FormEvent($builder, $form);
     $this->dispatch($eventName, $event);
 }