class ActionAddForm
Same name and namespace in other branches
- 10 core/modules/action/src/Form/ActionAddForm.php \Drupal\action\Form\ActionAddForm
- 8.9.x core/modules/action/src/Form/ActionAddForm.php \Drupal\action\Form\ActionAddForm
- 8.9.x core/modules/action/src/ActionAddForm.php \Drupal\action\ActionAddForm
Provides a form for action add forms.
@internal
Hierarchy
- class \Drupal\Core\Form\FormBase implements \Drupal\Core\Form\FormInterface, \Drupal\Core\DependencyInjection\ContainerInjectionInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Logger\LoggerChannelTrait, \Drupal\Core\Messenger\MessengerTrait, \Drupal\Core\Routing\RedirectDestinationTrait, \Drupal\Core\StringTranslation\StringTranslationTrait
- class \Drupal\Core\Entity\EntityForm implements \Drupal\Core\Entity\EntityFormInterface extends \Drupal\Core\Form\FormBase
- class \Drupal\action\Form\ActionFormBase extends \Drupal\Core\Entity\EntityForm
- class \Drupal\action\Form\ActionAddForm extends \Drupal\action\Form\ActionFormBase
- class \Drupal\action\Form\ActionFormBase extends \Drupal\Core\Entity\EntityForm
- class \Drupal\Core\Entity\EntityForm implements \Drupal\Core\Entity\EntityFormInterface extends \Drupal\Core\Form\FormBase
Expanded class hierarchy of ActionAddForm
1 file declares its use of ActionAddForm
- action.module in core/
modules/ action/ action.module - This is the Actions module for executing stored actions.
File
-
core/
modules/ action/ src/ Form/ ActionAddForm.php, line 12
Namespace
Drupal\action\FormView source
class ActionAddForm extends ActionFormBase {
/**
* {@inheritdoc}
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param string $action_id
* The action ID.
*/
public function buildForm(array $form, FormStateInterface $form_state, $action_id = NULL) {
$this->entity
->setPlugin($action_id);
// Derive the label and type from the action definition.
$definition = $this->entity
->getPluginDefinition();
$this->entity
->set('label', $definition['label']);
$this->entity
->set('type', $definition['type']);
return parent::buildForm($form, $form_state);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.