Mercurial > hg > cmmr2012-drupal-site
view core/modules/action/src/ActionAddForm.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
line wrap: on
line source
<?php namespace Drupal\action; use Drupal\Core\Form\FormStateInterface; /** * Provides a form for action add forms. * * @internal */ class ActionAddForm extends ActionFormBase { /** * {@inheritdoc} * * @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); } }