if ($elements['#access'
] instanceof AccessResultInterface
) { $this->
addCacheableDependency($elements,
$elements['#access'
]);
if (!
$elements['#access'
]->
isAllowed()) { // Abort, but bubble new cache metadata from the access result.
$context =
$this->
getCurrentRenderContext();
if (!
isset($context)) { trigger_error("Render context is empty, because render() was called outside of a renderRoot() or renderPlain() call. Use renderPlain()/renderRoot() or #lazy_builder/#pre_render instead.", E_USER_WARNING
);
return '';
} $context->
push(new BubbleableMetadata());
$context->
update($elements);
$context->
bubble();
return '';
} } elseif ($elements['#access'
] === FALSE
) { return '';
} } // Do not print elements twice.
if (!
empty($elements['#printed'
])) { return '';
}