public function RuleComponentForm::buildForm in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 src/Form/RuleComponentForm.php \Drupal\rng\Form\RuleComponentForm::buildForm()
- 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\FormCode
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);
}