public function WorkbenchPreprocess::isLatestVersionPage in Workbench Moderation 8.2
Same name and namespace in other branches
- 8 src/WorkbenchPreprocess.php \Drupal\workbench_moderation\WorkbenchPreprocess::isLatestVersionPage()
Checks whether a route is the "Latest version" tab of a node.
Parameters
\Drupal\node\Entity\Node $node: A node.
Return value
bool True if the current route is the latest version tab of the given node.
1 call to WorkbenchPreprocess::isLatestVersionPage()
- WorkbenchPreprocess::preprocessNode in src/
WorkbenchPreprocess.php - Wrapper for hook_preprocess_HOOK().
File
- src/
WorkbenchPreprocess.php, line 49
Class
- WorkbenchPreprocess
- Service to determine whether a route is the "Latest version" tab of a node.
Namespace
Drupal\workbench_moderationCode
public function isLatestVersionPage(Node $node) {
return $this->routeMatch
->getRouteName() == 'entity.node.latest_version' && ($pageNode = $this->routeMatch
->getParameter('node')) && $pageNode
->id() == $node
->id();
}