FilterFormatEditForm::form

public FilterFormatEditForm::form(array $form, FormStateInterface $form_state)

Gets the actual form array to be built.

Overrides FilterFormatFormBase::form

See also

\Drupal\Core\Entity\EntityForm::processForm()

\Drupal\Core\Entity\EntityForm::afterBuild()

File

core/modules/filter/src/FilterFormatEditForm.php, line 16

Class

FilterFormatEditForm
Provides a form for adding a filter format.

Namespace

Drupal\filter

Code

public function form(array $form, FormStateInterface $form_state) {
  if (!$this->entity->status()) {
    throw new NotFoundHttpException();
  }

  $form['#title'] = $this->entity->label();
  $form = parent::form($form, $form_state);
  $form['roles']['#default_value'] = array_keys(filter_get_roles_by_format($this->entity));
  return $form;
}
doc_Drupal
2016-10-29 09:14:39
Comments
Leave a Comment

Please login to continue.