interface InlineFormInterface in Commerce Core 8.2
Defines the interface for inline forms.
Inline forms are embeddable and reusable. They are used as an alternative to building complex custom form elements, which have problems with rebuilding on #ajax due to being processed too early. Unlike form elements, inline forms support dependency injection and allow swapping out the implementing class through an alter hook.
Just like form elements, inline forms are automatically validated and submitted when the complete form is validated/submitted.
Hierarchy
- interface \Drupal\Component\Plugin\ConfigurableInterface; interface \Drupal\Component\Plugin\PluginInspectionInterface
- interface \Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormInterface
Expanded class hierarchy of InlineFormInterface
All classes that implement InlineFormInterface
1 file declares its use of InlineFormInterface
File
- src/
Plugin/ Commerce/ InlineForm/ InlineFormInterface.php, line 21
Namespace
Drupal\commerce\Plugin\Commerce\InlineFormView source
interface InlineFormInterface extends ConfigurableInterface, PluginInspectionInterface {
/**
* Gets the inline form label.
*
* @return string
* The inline form label.
*/
public function getLabel();
/**
* Builds the inline form.
*
* @param array $inline_form
* The inline form, containing the following basic properties:
* - #parents: Identifies the location of the field values in $form_state.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state of the complete form.
*
* @return array
* The built inline form.
*/
public function buildInlineForm(array $inline_form, FormStateInterface $form_state);
/**
* Validates the inline form.
*
* @param array $inline_form
* The inline form, containing the following basic properties:
* - #parents: Identifies the location of the field values in $form_state.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state of the complete form.
*/
public function validateInlineForm(array &$inline_form, FormStateInterface $form_state);
/**
* Submits the inline form.
*
* @param array $inline_form
* The inline form, containing the following basic properties:
* - #parents: Identifies the location of the field values in $form_state.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state of the complete form.
*/
public function submitInlineForm(array &$inline_form, FormStateInterface $form_state);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigurableInterface:: |
public | function | Gets default configuration for this plugin. | 11 |
ConfigurableInterface:: |
public | function | Gets this plugin's configuration. | 12 |
ConfigurableInterface:: |
public | function | Sets the configuration for this plugin instance. | 12 |
InlineFormInterface:: |
public | function | Builds the inline form. | 1 |
InlineFormInterface:: |
public | function | Gets the inline form label. | 1 |
InlineFormInterface:: |
public | function | Submits the inline form. | 1 |
InlineFormInterface:: |
public | function | Validates the inline form. | 1 |
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 4 |
PluginInspectionInterface:: |
public | function | Gets the plugin_id of the plugin instance. | 2 |