You are here

protected function SettingsForm::getPluginForm in Entity Print 8.2

Same name and namespace in other branches
  1. 8 src/Form/SettingsForm.php \Drupal\entity_print\Form\SettingsForm::getPluginForm()

Gets a configuration form for the given plugin.

Parameters

string $plugin_id: The plugin id for which we want the form.

\Drupal\Core\Form\FormStateInterface $form_state: The form state object.

Return value

array The sub form structure for this plugin.

1 call to SettingsForm::getPluginForm()
SettingsForm::buildForm in src/Form/SettingsForm.php
Form constructor.

File

src/Form/SettingsForm.php, line 185

Class

SettingsForm
Defines a form that configures Entity Print settings.

Namespace

Drupal\entity_print\Form

Code

protected function getPluginForm($plugin_id, FormStateInterface $form_state) {
  $plugin = $this->pluginManager
    ->createInstance($plugin_id);
  $form = [
    '#type' => 'fieldset',
    '#title' => $this
      ->t('@engine Settings', [
      '@engine' => $plugin
        ->getPluginDefinition()['label'],
    ]),
    '#tree' => TRUE,
  ];
  return $form + $plugin
    ->buildConfigurationForm([], $form_state);
}