public render ( Neos\ContentRepository\Domain\Model\NodeInterface $node = null, string $mode = null ) : boolean | ||
$node | Neos\ContentRepository\Domain\Model\NodeInterface | Optional Node to use context from |
$mode | string | Optional rendering mode name to check if this specific mode is active |
Résultat | boolean |
public function render(NodeInterface $node = null, $mode = null)
{
$context = $this->getNodeContext($node);
$renderingMode = $context->getCurrentRenderingMode();
if ($mode !== null) {
$result = $renderingMode->getName() === $mode && $renderingMode->isEdit();
} else {
$result = $renderingMode->isEdit();
}
return $result;
}