private readonly EventDispatcherInterface
$eventDispatcher ) { } public function load(Request
$request, SalesChannelContext
$context): Page
{ return Profiler::
trace('generic-page-loader',
function D
) use ($request,
$context) { $page =
new Page();
if ($request->
isXmlHttpRequest()) { $this->eventDispatcher->
dispatch( new GenericPageLoadedEvent($page,
$context,
$request) );
return $page;
} $page->
setHeader( $this->headerLoader->
load($request,
$context) );
$page->
setFooter( $this->footerLoader->
load($request,
$context) );