You are here

public function RuleComponentForm::buildForm in RNG - Events and Registrations 8.2

Same name and namespace in other branches
  1. 8 src/Form/RuleComponentForm.php \Drupal\rng\Form\RuleComponentForm::buildForm()
  2. 3.x src/Form/RuleComponentForm.php \Drupal\rng\Form\RuleComponentForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides EntityForm::buildForm

File

src/Form/RuleComponentForm.php, line 78

Class

RuleComponentForm
Form controller for rng rule components.

Namespace

Drupal\rng\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this->entity
    ->getConfiguration();
  $manager = $this->entity
    ->getType() == 'condition' ? 'conditionManager' : 'actionManager';
  $this->plugin = $this->{$manager}
    ->createInstance($this->entity
    ->getPluginId(), $config);
  return parent::buildForm($form, $form_state);
}