public function CourseObjectNode::getTakeUrl in Course 3.x
Same name and namespace in other branches
- 8.3 modules/course_content/src/Course/Object/CourseObjectNode.php \Drupal\course_content\Course\Object\CourseObjectNode::getTakeUrl()
- 8.2 modules/course_content/src/Course/Object/CourseObjectNode.php \Drupal\course_content\Course\Object\CourseObjectNode::getTakeUrl()
Get the URL to take this course object, if any.
Outline handlers or subclasses should use getUrl().
Return value
Overrides CourseObject::getTakeUrl
File
- modules/
course_content/ src/ Course/ Object/ CourseObjectNode.php, line 93
Class
- CourseObjectNode
- A course object that uses a node as a base.
Namespace
Drupal\course_content\Course\ObjectCode
public function getTakeUrl() {
if ($this
->getNode()) {
return Url::fromRoute('entity.node.canonical', [
'node' => $this
->getNode()
->id(),
]);
}
}