Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state)
 {
     $cached_values = $form_state->getTemporaryValue('wizard');
     // Get the current form operation.
     $operation = $this->getOperation($cached_values);
     $form = $this->customizeForm($form, $form_state);
     /* @var $formClass \Drupal\Core\Form\FormInterface */
     $formClass = $this->classResolver->getInstanceFromDefinition($operation['form']);
     $form = $formClass->buildForm($form, $form_state);
     if (isset($operation['title'])) {
         $form['#title'] = $operation['title'];
     }
     $form['actions'] = $this->actions($formClass, $form_state);
     return $form;
 }
 /**
  * Returns the object used to build the form.
  *
  * @param \Symfony\Component\HttpFoundation\Request $request
  *   The request using this form.
  * @param string $form_arg
  *   Either a class name or a service ID.
  *
  * @return \Drupal\Core\Form\FormInterface
  *   The form object to use.
  */
 protected function getFormObject(Request $request, $form_arg)
 {
     return $this->classResolver->getInstanceFromDefinition($form_arg);
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 protected function getFormObject(RouteMatchInterface $route_match, $form_arg)
 {
     return $this->classResolver->getInstanceFromDefinition($form_arg);
 }