PageInformationFactory

final readonly class \TYPO3\CMS\Frontend\Page\PageInformationFactory

Create the PageInformation object. This is typically fired by a middleware. It does all the heavy lifting, page access checks, resolves shortcuts, workspaces, languages and similar.

Possible results:

  • The fully set up PageInformation object is returned.
  • A PageInformationCreationFailedException is thrown that contains an early Response from the ErrorController
  • A StatusException is thrown when ErrorController itself failed

Tags

todo:

This class also sets / resets the Context language aspect as not directly obvious side effect. This can't be refactored currently due to the dependency of stateful PageRepository to the stateful singleton Context.

Table of Contents

Methods

__construct()  : mixed
create()  : PageInformation
Set up proper PageInformation object later available as 'frontend.page.information' Request attribute.

Methods

__construct()

public __construct(Context $context, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger, RecordAccessVoter $accessVoter, ErrorController $errorController, SysTemplateRepository $sysTemplateRepository, PageLayoutResolver $pageLayoutResolver, TcaSchemaFactory $tcaSchemaFactory, PageTypeLinkResolver $pageTypeLinkResolver, PageDoktypeRegistry $pageDoktypeRegistry) : mixed

Parameters

$context : Context
$eventDispatcher : EventDispatcherInterface
$logger : LoggerInterface
$accessVoter : RecordAccessVoter
$errorController : ErrorController
$sysTemplateRepository : SysTemplateRepository
$pageLayoutResolver : PageLayoutResolver
$tcaSchemaFactory : TcaSchemaFactory
$pageTypeLinkResolver : PageTypeLinkResolver
$pageDoktypeRegistry : PageDoktypeRegistry

create()

Set up proper PageInformation object later available as 'frontend.page.information' Request attribute.

public create(ServerRequestInterface $request) : PageInformation

At this point, the Context object already contains relevant preview settings, for instance if a backend user is logged in.

As a not obvious side effect, this class also sets the

Parameters

$request : ServerRequestInterface

Tags

throws
PageInformationCreationFailedException
throws
StatusException

Return values

PageInformation
On this page