You are here

public function CourseWebformEventSubscriber::onRequest in Course 8.3

Same name and namespace in other branches
  1. 8.2 modules/course_webform/src/EventSubscriber/CourseWebformEventSubscriber.php \Drupal\course_webform\EventSubscriber\CourseWebformEventSubscriber::onRequest()
  2. 3.x modules/course_webform/src/EventSubscriber/CourseWebformEventSubscriber.php \Drupal\course_webform\EventSubscriber\CourseWebformEventSubscriber::onRequest()

If the current node is a course object, fulfill it for the current user.

Parameters

GetResponseEvent $event:

File

modules/course_webform/src/EventSubscriber/CourseWebformEventSubscriber.php, line 23

Class

CourseWebformEventSubscriber

Namespace

Drupal\course_webform\EventSubscriber

Code

public function onRequest(GetResponseEvent $event) {
  $route_match = Drupal::routeMatch();
  if ($route_match
    ->getRouteName() == 'entity.webform.canonical') {
    $webform = $route_match
      ->getParameter('webform');

    // Process fulfillment or something
  }
}