class ConfigTestController

Route controller class for the config_test module.

Hierarchy

Expanded class hierarchy of ConfigTestController

File

drupal/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestController.php, line 18
Contains \Drupal\config_test\ConfigTestController.

Namespace

Drupal\config_test
View source
class ConfigTestController {

  /**
   * Presents the ConfigTest edit form.
   *
   * @param \Drupal\config_test\Plugin\Core\Entity\ConfigTest $config_test
   *   The ConfigTest object to edit.
   *
   * @return array
   *   A form array as expected by drupal_render().
   */
  public function edit(ConfigTest $config_test) {
    drupal_set_title(String::format('Edit %label', array(
      '%label' => $config_test
        ->label(),
    )), PASS_THROUGH);
    return entity_get_form($config_test);
  }

  /**
   * Enables a ConfigTest object.
   *
   * @param \Drupal\config_test\ConfigTest $config_test
   *   The ConfigTest object to enable.
   *
   * @return \Symfony\Component\HttpFoundation\RedirectResponse
   *   A redirect response to the config_test listing page.
   */
  function enable(ConfigTest $config_test) {
    $config_test
      ->enable()
      ->save();
    return new RedirectResponse(url('admin/structure/config_test', array(
      'absolute' => TRUE,
    )));
  }

  /**
   * Disables a ConfigTest object.
   *
   * @param \Drupal\config_test\ConfigTest $config_test
   *   The ConfigTest object to disable.
   *
   * @return \Symfony\Component\HttpFoundation\RedirectResponse
   *   A redirect response to the config_test listing page.
   */
  function disable(ConfigTest $config_test) {
    $config_test
      ->disable()
      ->save();
    return new RedirectResponse(url('admin/structure/config_test', array(
      'absolute' => TRUE,
    )));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigTestController::disable function Disables a ConfigTest object.
ConfigTestController::edit public function Presents the ConfigTest edit form.
ConfigTestController::enable function Enables a ConfigTest object.