class ContentControllerSubscriber in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/EventSubscriber/ContentControllerSubscriber.php \Drupal\Core\EventSubscriber\ContentControllerSubscriber
Sets the request format onto the request object.
@todo Remove this event subscriber after https://www.drupal.org/node/2092647 has landed.
Hierarchy
- class \Drupal\Core\EventSubscriber\ContentControllerSubscriber implements EventSubscriberInterface
Expanded class hierarchy of ContentControllerSubscriber
File
- core/lib/ Drupal/ Core/ EventSubscriber/ ContentControllerSubscriber.php, line 20 
- Contains \Drupal\Core\EventSubscriber\ContentControllerSubscriber.
Namespace
Drupal\Core\EventSubscriberView source
class ContentControllerSubscriber implements EventSubscriberInterface {
  /**
   * Sets the _controller on a request when a _form is defined.
   *
   * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
   *   The event to process.
   */
  public function onRequestDeriveFormWrapper(GetResponseEvent $event) {
    $request = $event
      ->getRequest();
    if ($request->attributes
      ->has('_form')) {
      $request->attributes
        ->set('_controller', 'controller.form:getContentResult');
    }
  }
  /**
   * Registers the methods in this class that should be listeners.
   *
   * @return array
   *   An array of event listener definitions.
   */
  static function getSubscribedEvents() {
    $events[KernelEvents::REQUEST][] = array(
      'onRequestDeriveFormWrapper',
      25,
    );
    return $events;
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| ContentControllerSubscriber:: | static | function | Registers the methods in this class that should be listeners. Overrides EventSubscriberInterface:: | |
| ContentControllerSubscriber:: | public | function | Sets the _controller on a request when a _form is defined. | 
