FilterFormatAddForm.php

Same filename and directory in other branches
  1. 9 core/modules/filter/src/FilterFormatAddForm.php
  2. 8.9.x core/modules/filter/src/FilterFormatAddForm.php
  3. 10 core/modules/filter/src/FilterFormatAddForm.php

Namespace

Drupal\filter

File

core/modules/filter/src/FilterFormatAddForm.php

View source
<?php

namespace Drupal\filter;

use Drupal\Core\Form\FormStateInterface;

/**
 * Provides a form for adding a filter format.
 *
 * @internal
 */
class FilterFormatAddForm extends FilterFormatFormBase {
  
  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    parent::submitForm($form, $form_state);
    $this->messenger()
      ->addStatus($this->t('Added text format %format.', [
      '%format' => $this->entity
        ->label(),
    ]));
    $form_state->setRedirect('filter.admin_overview');
    return $this->entity;
  }

}

Classes

Title Deprecated Summary
FilterFormatAddForm Provides a form for adding a filter format.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.