Drupal 8  8.0.2
Actions Class Reference
Inheritance diagram for Actions:

Public Member Functions

 getInfo ()
 
- Public Member Functions inherited from Container
 getInfo ()
 
- Public Member Functions inherited from PluginInspectionInterface
 getPluginId ()
 
 getPluginDefinition ()
 

Static Public Member Functions

static processActions (&$element, FormStateInterface $form_state, &$complete_form)
 
static preRenderActionsDropbutton (&$element, FormStateInterface $form_state, &$complete_form)
 
- Static Public Member Functions inherited from Container
static processContainer (&$element, FormStateInterface $form_state, &$complete_form)
 
- Static Public Member Functions inherited from RenderElement
static setAttributes (&$element, $class=array())
 
static preRenderGroup ($element)
 
static processAjaxForm (&$element, FormStateInterface $form_state, &$complete_form)
 
static preRenderAjaxForm ($element)
 
static processGroup (&$element, FormStateInterface $form_state, &$complete_form)
 

Detailed Description

Provides a wrapper element to group one or more buttons in a form.

Use of a single Actions element with an array key of 'actions' to group the primary submit buttons on a form helps to ensure proper styling in themes, and enables other modules to properly alter a form's actions.

Usage example:

$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);

("actions")

Member Function Documentation

getInfo ( )

{Returns the element properties for this element.

Returns
array An array of element properties. See ::getInfo() for documentation of the standard properties of all elements, and the return value format.
}

Implements ElementInterface.

static preRenderActionsDropbutton ( $element,
FormStateInterface  $form_state,
$complete_form 
)
static

#pre_render callback for #type 'actions'.

This callback iterates over all child elements of the #type 'actions' container to look for elements with a #dropbutton property, so as to group those elements into dropbuttons. As such, it works similar to #group, but is specialized for dropbuttons.

The value of #dropbutton denotes the dropbutton to group the child element into. For example, two different values of 'foo' and 'bar' on child elements would generate two separate dropbuttons, which each contain the corresponding buttons.

Parameters
array$elementThe #type 'actions' element to process.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
array$complete_formThe complete form structure.
Returns
array The processed #type 'actions' element, including individual buttons grouped into new #type 'dropbutton' elements.

References Element\children(), and Drupal\service().

Here is the call graph for this function:

static processActions ( $element,
FormStateInterface  $form_state,
$complete_form 
)
static

Processes a form actions container element.

Parameters
array$elementAn associative array containing the properties and children of the form actions container.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
array$complete_formThe complete form structure.
Returns
array The processed element.

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