Drupal 8  8.0.2
Weight Class Reference
Inheritance diagram for Weight:

Public Member Functions

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

Static Public Member Functions

static processWeight (&$element, FormStateInterface $form_state, &$complete_form)
 
- Static Public Member Functions inherited from FormElement
static valueCallback (&$element, $input, FormStateInterface $form_state)
 
static processPattern (&$element, FormStateInterface $form_state, &$complete_form)
 
static validatePattern (&$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 form element for input of a weight.

Weights are integers used to indicate ordering, with larger numbers later in the order.

Properties:

  • #delta: The range of possible weight values used. A delta of 10 would indicate possible weight values between -10 and 10.

Usage example:

$form['weight'] = array(
'#type' => 'weight',
'#title' => t('Weight'),
'#default_value' => $edit['weight'],
'#delta' => 10,
);

("weight")

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 processWeight ( $element,
FormStateInterface  $form_state,
$complete_form 
)
static

Expands a weight element into a select element.

References Drupal\config(), and Drupal\service().

Here is the call graph for this function:


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