Drupal 8  8.0.2
ViewsForm Class Reference
Inheritance diagram for ViewsForm:

Public Member Functions

 __construct (ClassResolverInterface $class_resolver, UrlGeneratorInterface $url_generator, RequestStack $requestStack, $view_id, $view_display_id)
 
 getFormId ()
 
 buildForm (array $form, FormStateInterface $form_state, ViewExecutable $view=NULL, $output=[])
 
 validateForm (array &$form, FormStateInterface $form_state)
 
 submitForm (array &$form, FormStateInterface $form_state)
 
- Public Member Functions inherited from FormInterface
 buildForm (array $form, FormStateInterface $form_state)
 

Static Public Member Functions

static create (ContainerInterface $container, $view_id=NULL, $view_display_id=NULL)
 
- Static Public Member Functions inherited from ContainerInjectionInterface
static create (ContainerInterface $container)
 

Protected Member Functions

 getFormObject (FormStateInterface $form_state)
 

Protected Attributes

 $classResolver
 
 $requestStack
 
 $urlGenerator
 
 $viewId
 
 $viewDisplayId
 

Detailed Description

Provides a base class for single- or multistep view forms.

This class only dispatches logic to the form for the current step. The form is always assumed to be multistep, even if it has only one step (which by default is ). That way it is actually possible for modules to have a multistep form if they need to.

Constructor & Destructor Documentation

__construct ( ClassResolverInterface  $class_resolver,
UrlGeneratorInterface  $url_generator,
RequestStack  $requestStack,
  $view_id,
  $view_display_id 
)

Constructs a ViewsForm object.

Parameters
\Drupal\Core\DependencyInjection\ClassResolverInterface$class_resolverThe class resolver to get the subform form objects.
\Drupal\Core\Routing\UrlGeneratorInterface$url_generatorThe url generator to generate the form action.
\Symfony\Component\HttpFoundation\RequestStack$requestStackThe request stack.
string$view_idThe ID of the view.
string$view_display_idThe ID of the active view's display.

References Drupal\requestStack(), and Drupal\urlGenerator().

Here is the call graph for this function:

Member Function Documentation

buildForm ( array  $form,
FormStateInterface  $form_state,
ViewExecutable  $view = NULL,
  $output = [] 
)

{}

References UrlHelper\filterQueryParameters(), Url\fromRoute(), FormStateInterface\get(), ViewsForm\getFormObject(), Drupal\requestStack(), and FormStateInterface\set().

Here is the call graph for this function:

static create ( ContainerInterface  $container,
  $view_id = NULL,
  $view_display_id = NULL 
)
static

{}

Referenced by DisplayPluginBase\elementPreRender().

Here is the caller graph for this function:

getFormId ( )

{Returns a unique string identifying the form.

Returns
string The unique string identifying the form.
}

Implements FormInterface.

getFormObject ( FormStateInterface  $form_state)
protected

Returns the object used to build the step form.

Parameters
\Drupal\Core\Form\FormStateInterface$form_stateThe form_state of the current form.
Returns
The form object to use.

References FormStateInterface\get().

Referenced by ViewsForm\buildForm(), ViewsForm\submitForm(), and ViewsForm\validateForm().

Here is the call graph for this function:

Here is the caller graph for this function:

submitForm ( array &  $form,
FormStateInterface  $form_state 
)

{Form submission handler.

Parameters
array$formAn associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
}

Implements FormInterface.

References ViewsForm\getFormObject().

Here is the call graph for this function:

validateForm ( array &  $form,
FormStateInterface  $form_state 
)

{Form validation handler.

Parameters
array$formAn associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
}

Implements FormInterface.

References ViewsForm\getFormObject().

Here is the call graph for this function:


The documentation for this class was generated from the following file: