public function PagererPresetPaneEditForm::buildForm in Pagerer 8
Same name and namespace in other branches
- 8.2 src/Form/PagererPresetPaneEditForm.php \Drupal\pagerer\Form\PagererPresetPaneEditForm::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/ PagererPresetPaneEditForm.php, line 50
Class
- PagererPresetPaneEditForm
- Form handler for Pagerer presets' panes.
Namespace
Drupal\pagerer\FormCode
public function buildForm(array $form, FormStateInterface $form_state, $pane = NULL) {
$this->paneLabels = [
'left' => $this
->t('left'),
'center' => $this
->t('center'),
'right' => $this
->t('right'),
];
$this->pane = $pane;
$this->style = $this->entity
->getPaneData($pane, 'style');
$this->config = $this->entity
->getPaneData($pane, 'config') ?: [];
$this->plugin = $this->styleManager
->createInstance($this->style, $this->config);
return parent::buildForm($form, $form_state);
}