public function ConfigTestFormController::save

Overrides Drupal\Core\Entity\EntityFormController::save().

Overrides EntityFormController::save

File

drupal/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php, line 71
Contains Drupal\config_test\ConfigTestFormController.

Class

ConfigTestFormController
Form controller for the test config edit forms.

Namespace

Drupal\config_test

Code

public function save(array $form, array &$form_state) {
  $entity = $this->entity;
  $status = $entity
    ->save();
  if ($status === SAVED_UPDATED) {
    drupal_set_message(format_string('%label configuration has been updated.', array(
      '%label' => $entity
        ->label(),
    )));
  }
  else {
    drupal_set_message(format_string('%label configuration has been created.', array(
      '%label' => $entity
        ->label(),
    )));
  }
  $form_state['redirect'] = 'admin/structure/config_test';
}