/** * {@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; }
/** * 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); }