You are here

public function HomeboxLayoutForm::buildForm in Homebox 8

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/HomeboxLayoutForm.php, line 18

Class

HomeboxLayoutForm
Form controller for Homebox Layout edit forms.

Namespace

Drupal\homebox\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {

  /* @var $entity \Drupal\homebox\Entity\HomeboxLayout */
  $form = parent::buildForm($form, $form_state);
  if (!$this->entity
    ->isNew()) {
    $form['new_revision'] = [
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Create new revision'),
      '#default_value' => FALSE,
      '#weight' => 10,
    ];
  }
  return $form;
}