public function CourseObjectNode::getViewUrl 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::getViewUrl()
- 8.2 modules/course_content/src/Course/Object/CourseObjectNode.php \Drupal\course_content\Course\Object\CourseObjectNode::getViewUrl()
Get the URL to view this course object, if any.
Return value
Overrides CourseObject::getViewUrl
File
- modules/
course_content/ src/ Course/ Object/ CourseObjectNode.php, line 111
Class
- CourseObjectNode
- A course object that uses a node as a base.
Namespace
Drupal\course_content\Course\ObjectCode
public function getViewUrl() {
if ($this
->getNode()) {
return Url::fromRoute('entity.node.canonical', [
'node' => $this
->getNode()
->id(),
]);
}
}