SysTemplateTreeBuilder
Create a tree representing all TypoScript includes.
This is the 'middle' part of the TypoScript parsing process: The tokenizers as "lowest" structure create line streams from TypoScript, the AST builder as "highest" structure create the TypoScript object tree.
This structure gathers all TypoScript snippets that have to be tokenized, and creates a tree with include nodes and sub include nodes.
It is called in frontend (and backend "Template" module) with the page rootline, gets all attached sys_template records, gets their content and various sub includes and takes care of correct include order.
This class together with TreeFromLineStreamBuilder also takes care of conditions and imports ("@import"): Those create child nodes in the tree. To evaluate conditions, the tree is later traversed, condition verdicts (true / false) are determined, to see if condition's child nodes should be considered in AST.
The IncludeTree is "runtime stateless": Constants values and conditions are not evaluated here, so the tree is always the same for a given rootline. This makes this structure cache-able: In frontend, the tree (or sub parts of it) is cached and fetched from cache for next call. This means the entire tree-building and tokenizing is suppressed. After that runtime information is added: Conditions are evaluated, and the AST is built from given IncludeTree.
Tags
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Methods
Methods
__construct()
public
__construct(ConnectionPool $connectionPool, PackageManager $packageManager, Context $context, TreeFromLineStreamBuilder $treeFromTokenStreamBuilder, SetRegistry $setRegistry) : mixed
Parameters
- $connectionPool : ConnectionPool
- $packageManager : PackageManager
- $context : Context
- $treeFromTokenStreamBuilder : TreeFromLineStreamBuilder
- $setRegistry : SetRegistry
getTreeBySysTemplateRowsAndSite()
public
getTreeBySysTemplateRowsAndSite("constants"|"setup" $type, array<string|int, mixed> $sysTemplateRows, TokenizerInterface $tokenizer[, SiteInterface|null $site = null ][, PhpFrontend|null $cache = null ]) : RootInclude
Parameters
- $type : "constants"|"setup"
- $sysTemplateRows : array<string|int, mixed>
- $tokenizer : TokenizerInterface
- $site : SiteInterface|null = null
- $cache : PhpFrontend|null = null