You are here

public function PageParametersForm::buildForm in Page Manager 8.4

Same name and namespace in other branches
  1. 8 page_manager_ui/src/Form/PageParametersForm.php \Drupal\page_manager_ui\Form\PageParametersForm::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 FormInterface::buildForm

File

page_manager_ui/src/Form/PageParametersForm.php, line 27

Class

PageParametersForm

Namespace

Drupal\page_manager_ui\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $cached_values = $form_state
    ->getTemporaryValue('wizard');
  $this->machine_name = $cached_values['id'];
  $form['items'] = [
    '#type' => 'markup',
    '#prefix' => '<div id="available-parameters">',
    '#suffix' => '</div>',
    '#theme' => 'table',
    '#header' => [
      $this
        ->t('Machine name'),
      $this
        ->t('Label'),
      $this
        ->t('Type'),
      $this
        ->t('Operations'),
    ],
    '#rows' => $this
      ->renderRows($cached_values),
    '#empty' => $this
      ->t('There are no parameters defined for this page.'),
  ];
  return $form;
}