FrontendTypoScriptFactory

Read onlyYes
FinalYes

Create FrontendTypoScript with its details. This is typically used by a Frontend middleware to calculate the TypoScript needed to satisfy rendering details of the specific Request.

Internal

Methods signatures and detail implementations are still subject to change.

Table of Contents

Methods

__construct()  : mixed
createSettingsAndSetupConditions()  : FrontendTypoScript
First step of TypoScript calculations.
createSetupConfigOrFullSetup()  : FrontendTypoScript
Enrich the given FrontendTypoScript object with TypoScript 'setup' relevant data.

Methods

__construct()

public __construct(ContainerInterface $container, EventDispatcherInterface $eventDispatcher, SysTemplateTreeBuilder $treeBuilder, LossyTokenizer $tokenizer, IncludeTreeTraverser $includeTreeTraverser, ConditionVerdictAwareIncludeTreeTraverser $includeTreeTraverserConditionVerdictAware) : mixed
Parameters
$container : ContainerInterface
$eventDispatcher : EventDispatcherInterface
$treeBuilder : SysTemplateTreeBuilder
$tokenizer : LossyTokenizer
$includeTreeTraverser : IncludeTreeTraverser
$includeTreeTraverserConditionVerdictAware : ConditionVerdictAwareIncludeTreeTraverser

createSettingsAndSetupConditions()

First step of TypoScript calculations.

public createSettingsAndSetupConditions(SiteInterface $site, array<string|int, mixed> $sysTemplateRows, array<string|int, mixed> $expressionMatcherVariables, PhpFrontend|null $typoScriptCache) : FrontendTypoScript

This is always called, even in FE fully cached pages context since the page cache entry depends on setup condition verdicts, which depends on settings.

Returns the FrontendTypoScript object with these parameters set:

  • settingsTree: The full settings ("constants") AST
  • flatSettings: Flattened list of settings, derived from settings tree
  • settingsConditionList: Settings conditions with verdicts of this Request
  • setupConditionList: Setup conditions with verdicts of this Request
  • (sometimes) setupIncludeTree: The setup include tree if it had to be calculated
Parameters
$site : SiteInterface
$sysTemplateRows : array<string|int, mixed>
$expressionMatcherVariables : array<string|int, mixed>
$typoScriptCache : PhpFrontend|null
Return values
FrontendTypoScript

createSetupConfigOrFullSetup()

Enrich the given FrontendTypoScript object with TypoScript 'setup' relevant data.

public createSetupConfigOrFullSetup(bool $needsFullSetup, FrontendTypoScript $frontendTypoScript, SiteInterface $site, array<string|int, mixed> $sysTemplateRows, array<string|int, mixed> $expressionMatcherVariables, string $type, PhpFrontend|null $typoScriptCache, ServerRequestInterface|null $request) : FrontendTypoScript

The method is called in FE after an attempt to retrieve page content from cache has been done. There are three possible outcomes:

  • The page has been retrieved from cache and the content does not contain uncached "_INT" objects
  • The page has been retrieved from cache and the content does contain uncached "_INT" objects
  • The page could not be retrieved from cache

If the page could not be retrieved from cache, or if the cached page content contains "_INT" objects, flag $needsFullSetup is given true, and the full TypoScript is calculated since at least parts of the page content has to be rendered, which then needs full TypoScript. If the page could be retrieved from cache, and contains no "_INT" objects, $needsFullSetup in false, the rendering chain only needs the "config." part of TypoScript to satisfy the remaining middlewares.

The method implements these variants and tries to add as little overhead as possible.

Returns the FrontendTypoScript object:

  • configTree: Always set. Global TypoScript 'config.' merged with overrides from given type/typeNum "page.config.".
  • configArray: Always set. Array representation of configTree.
  • setupTree: Not set if $needsFullSetup=false and configTree could be retrieved from cache. Full TypoScript setup.
  • setupArray: Not set if $needsFullSetup=false and configTree could be retrieved from cache. Array representation of setupTree.
  • pageTree: Not set if $needsFullSetup=false and configTree could be retrieved from cache, or if no PAGE object could be determined. The 'PAGE' object tree for given type/typeNum.
  • pageArray: Not set if $needsFullSetup=false and configTree could be retrieved from cache, or if no PAGE object could be determined. Array representation of PageTree.
Parameters
$needsFullSetup : bool
$frontendTypoScript : FrontendTypoScript
$site : SiteInterface
$sysTemplateRows : array<string|int, mixed>
$expressionMatcherVariables : array<string|int, mixed>
$type : string
$typoScriptCache : PhpFrontend|null
$request : ServerRequestInterface|null
Return values
FrontendTypoScript

        
On this page

Search results