public function FilterFormatEditForm::form in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/filter/src/FilterFormatEditForm.php \Drupal\filter\FilterFormatEditForm::form()
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 21 - Contains \Drupal\filter\FilterFormatEditForm.
Class
- FilterFormatEditForm
- Provides a form for adding a filter format.
Namespace
Drupal\filterCode
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;
}