Drupal 8  8.0.2
FormController Class Reference
Inheritance diagram for FormController:

Public Member Functions

 __construct (ControllerResolverInterface $controller_resolver, FormBuilderInterface $form_builder)
 
 getContentResult (Request $request, RouteMatchInterface $route_match)
 

Protected Member Functions

 getFormArgument (RouteMatchInterface $route_match)
 
 getFormObject (RouteMatchInterface $route_match, $form_arg)
 

Protected Attributes

 $controllerResolver
 
 $formBuilder
 

Detailed Description

Common base class for form interstitial controllers.

Todo:
Make this a trait in PHP 5.4.

Constructor & Destructor Documentation

__construct ( ControllerResolverInterface  $controller_resolver,
FormBuilderInterface  $form_builder 
)

Constructs a new object.

Parameters
\Drupal\Core\Controller\ControllerResolverInterface$controller_resolverThe controller resolver.
\Drupal\Core\Form\FormBuilderInterface$form_builderThe form builder.

References Drupal\formBuilder().

Here is the call graph for this function:

Member Function Documentation

getContentResult ( Request  $request,
RouteMatchInterface  $route_match 
)

Invokes the form and returns the result.

Parameters
\Symfony\Component\HttpFoundation\Request$requestThe request object.
\Drupal\Core\Routing\RouteMatchInterface$route_matchThe route match.
Returns
array The render array that results from invoking the controller.

References Drupal\formBuilder(), FormController\getFormArgument(), and FormController\getFormObject().

Here is the call graph for this function:

getFormArgument ( RouteMatchInterface  $route_match)
abstractprotected

Extracts the form argument string from a request.

Depending on the type of form the argument string may be stored in a different request attribute.

One example of a route definition is given below.

defaults:
_form: Drupal\example\Form\ExampleForm
Parameters
\Drupal\Core\Routing\RouteMatchInterface$route_matchThe route match object from which to extract a form definition string.
Returns
string The form definition string.

Referenced by FormController\getContentResult().

Here is the caller graph for this function:

getFormObject ( RouteMatchInterface  $route_match,
  $form_arg 
)
abstractprotected

Returns the object used to build the form.

Parameters
\Drupal\Core\Routing\RouteMatchInterface$route_matchThe route match.
string$form_argEither a class name or a service ID.
Returns
The form object to use.

Referenced by FormController\getContentResult().

Here is the caller graph for this function:


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