bundles/BlockManagerBundle/Templating/Twig/GlobalVariable.php
public function getLayoutView()
    {
        $currentRequest = $this->requestStack->getCurrentRequest();
        $masterRequest = $this->requestStack->getMasterRequest();

        if (!$currentRequest instanceof Request || !$masterRequest instanceof Request) {
            return null;
        }

        if ($masterRequest->attributes->has('ngbmExceptionLayoutView')) {
            if ($currentRequest !== $masterRequest || !$masterRequest->attributes->has('ngbmLayoutView')) {
                return $masterRequest->attributes->get('ngbmExceptionLayoutView');
            }
        }

        return $masterRequest->attributes->get('ngbmLayoutView');
    }
public function getLayoutView()
    {
        $currentRequest = $this->requestStack->getCurrentRequest();
        $masterRequest = $this->requestStack->getMasterRequest();

        if (!$currentRequest instanceof Request || !$masterRequest instanceof Request) {
            return null;
        }

        if ($masterRequest->attributes->has('ngbmExceptionLayoutView')) {
            if ($currentRequest !== $masterRequest || !$masterRequest->attributes->has('ngbmLayoutView')) {
                return $masterRequest->attributes->get('ngbmExceptionLayoutView');
            }
        }

        return $masterRequest->attributes->get('ngbmLayoutView');
    }
public function getLayoutView ( ) { $ currentRequest = $ this -> requestStack -> getCurrentRequest ( ) ; $ masterRequest = $ this -> requestStack -> getMasterRequest ( ) ; if ( ! $ currentRequest instanceof Request || ! $ masterRequest instanceof Request ) { return null ; } if ( $ masterRequest -> attributes -> has ( 'ngbmExceptionLayoutView' ) ) { if ( $ currentRequest !== $ masterRequest || ! $ masterRequest -> attributes -> has ( 'ngbmLayoutView' ) ) { return $ masterRequest -> attributes -> get ( 'ngbmExceptionLayoutView' ) ; } } return $ masterRequest -> attributes -> get ( 'ngbmLayoutView' ) ; }
Returns the currently resolved layout view.

Since the regular Symfony exceptions are rendered only in sub-requests,
we can return the resolved non-error layout for master requests even if the
exception layout is resolved too (that might happen if an error or exception
happened inside a user implemented sub-request, like rendering a block
item).

In other words, we return the resolved exception layout only in case of a
sub-request (this case happens if an error/exception happens during the
rendering of the page) or in case of a master request if non-error layout
is NOT resolved (this case happens if an error/exception happens before
the rendering of the page).

All other cases receive the non-error layout if it exists.

@return \Netgen\BlockManager\View\View\LayoutViewInterface|false|null
Returns the currently resolved layout view .