You are here

function course_context in Course 8.3

Same name and namespace in other branches
  1. 8.2 course.module \course_context()
  2. 6 course.module \course_context()
  3. 7.2 course.module \course_context()
  4. 7 course.module \course_context()
  5. 3.x course.module \course_context()

Course content handler callback.

1 call to course_context()
CourseEventSubscriber::onRequest in src/EventSubscriber/CourseEventSubscriber.php
Check if the current node will fulfill an object.
1 string reference to 'course_context'
course_course_handlers in ./course.module
Implements hook_course_handlers().

File

./course.module, line 695
course.module Core functionality for Courses.

Code

function course_context() {
  $route_match = Drupal::routeMatch();
  if (in_array($route_match
    ->getRouteName(), [
    'course.take',
    'course.object',
  ])) {
    $course = $route_match
      ->getParameter('course');
    course_set_context($course);
  }
}