You are here

function CourseObjectWebform::getTakeUrl in Course 8.2

Same name and namespace in other branches
  1. 8.3 modules/course_webform/src/Plugin/course/CourseObject/CourseObjectWebform.php \Drupal\course_webform\Plugin\course\CourseObject\CourseObjectWebform::getTakeUrl()
  2. 3.x modules/course_webform/src/Plugin/course/CourseObject/CourseObjectWebform.php \Drupal\course_webform\Plugin\course\CourseObject\CourseObjectWebform::getTakeUrl()

Get the URL to take this course object, if any.

Outline handlers or subclasses should use getUrl().

Return value

Url

Overrides CourseObject::getTakeUrl

File

modules/course_webform/src/Plugin/course/CourseObject/CourseObjectWebform.php, line 136

Class

CourseObjectWebform
Plugin annotation @CourseObject( id = "webform", label = "Webform", handlers = { "fulfillment" = "\Drupal\course_webform\Plugin\course\CourseObject\CourseObjectWebformFulfillment" } )

Namespace

Drupal\course_webform\Plugin\course\CourseObject

Code

function getTakeUrl() {
  $url = Url::fromRoute('entity.webform.canonical', [
    'webform' => $this
      ->getInstanceId(),
  ]);
  return $url;
}