ImageStyleAddForm.php

Same filename in other branches
  1. 9 core/modules/image/src/Form/ImageStyleAddForm.php
  2. 8.9.x core/modules/image/src/Form/ImageStyleAddForm.php
  3. 10 core/modules/image/src/Form/ImageStyleAddForm.php

Namespace

Drupal\image\Form

File

core/modules/image/src/Form/ImageStyleAddForm.php

View source
<?php

namespace Drupal\image\Form;

use Drupal\Core\Form\FormStateInterface;

/**
 * Controller for image style addition forms.
 *
 * @internal
 */
class ImageStyleAddForm extends ImageStyleFormBase {
    
    /**
     * {@inheritdoc}
     */
    public function submitForm(array &$form, FormStateInterface $form_state) {
        parent::submitForm($form, $form_state);
        $this->messenger()
            ->addStatus($this->t('Style %name was created.', [
            '%name' => $this->entity
                ->label(),
        ]));
    }
    
    /**
     * {@inheritdoc}
     */
    public function actions(array $form, FormStateInterface $form_state) {
        $actions = parent::actions($form, $form_state);
        $actions['submit']['#value'] = $this->t('Create new style');
        return $actions;
    }

}

Classes

Title Deprecated Summary
ImageStyleAddForm Controller for image style addition forms.

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