function NodeRouteContext::getAvailableContexts
Same name in other branches
- 9 core/modules/node/src/ContextProvider/NodeRouteContext.php \Drupal\node\ContextProvider\NodeRouteContext::getAvailableContexts()
- 8.9.x core/modules/node/src/ContextProvider/NodeRouteContext.php \Drupal\node\ContextProvider\NodeRouteContext::getAvailableContexts()
- 10 core/modules/node/src/ContextProvider/NodeRouteContext.php \Drupal\node\ContextProvider\NodeRouteContext::getAvailableContexts()
Overrides ContextProviderInterface::getAvailableContexts
File
-
core/
modules/ node/ src/ ContextProvider/ NodeRouteContext.php, line 76
Class
- NodeRouteContext
- Sets the current node as a context on node routes.
Namespace
Drupal\node\ContextProviderCode
public function getAvailableContexts() {
$context = EntityContext::fromEntityTypeId('node', $this->t('Node from URL'));
return [
'node' => $context,
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.