TYPO3  7.6
Public Member Functions | Protected Attributes | List of all members
ParsingState Class Reference
Inheritance diagram for ParsingState:
ParsedTemplateInterface

Public Member Functions

 setRootNode (\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $rootNode)
 
 getRootNode ()
 
 render (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 pushNodeToStack (\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $node)
 
 getNodeFromStack ()
 
 popNodeFromStack ()
 
 countNodeStack ()
 
 getVariableContainer ()
 
 setLayoutNameNode (\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $layoutNameNode)
 
 getLayoutNameNode ()
 
 hasLayout ()
 
 getLayoutName (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 isCompilable ()
 
 setCompilable ($compilable)
 
 isCompiled ()
 

Protected Attributes

 $rootNode
 
 $nodeStack = array()
 
 $variableContainer
 
 $layoutNameNode
 
 $compilable = true
 

Detailed Description

Stores all information relevant for one parsing pass - that is, the root node, and the current stack of open nodes (nodeStack) and a variable container used for PostParseFacets.

Definition at line 19 of file ParsingState.php.

Member Function Documentation

countNodeStack ( )

Count the size of the node stack

Returns
int Number of elements on the node stack (i.e. number of currently open Fluid tags)

Definition at line 125 of file ParsingState.php.

getLayoutName ( \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface  $renderingContext)

Returns the name of the layout that is defined within the current template via <f:layout name="..." /> If no layout is defined, this returns NULL This requires the current rendering context in order to be able to evaluate the layout name

Parameters
\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface$renderingContext
Returns
string
Exceptions
\TYPO3\CMS\Fluid\View\Exception

Implements ParsedTemplateInterface.

Definition at line 178 of file ParsingState.php.

References ParsingState\hasLayout().

getLayoutNameNode ( )
Returns

Definition at line 153 of file ParsingState.php.

References ParsingState\$layoutNameNode.

getNodeFromStack ( )

Get the top stack element, without removing it.

Returns
the top stack element.

Definition at line 105 of file ParsingState.php.

getRootNode ( )

Get root node of this parsing state.

Returns
The root node

Definition at line 72 of file ParsingState.php.

References ParsingState\$rootNode.

getVariableContainer ( )

Returns a variable container which will be then passed to the postParseFacet.

Returns
The variable container or NULL if none has been set yet
Todo:
Rename to getPostParseVariableContainer

Implements ParsedTemplateInterface.

Definition at line 136 of file ParsingState.php.

References ParsingState\$variableContainer.

hasLayout ( )

Returns TRUE if the current template has a template defined via <f:layout name="..." />

See Also
getLayoutName()
Returns
bool

Implements ParsedTemplateInterface.

Definition at line 164 of file ParsingState.php.

Referenced by ParsingState\getLayoutName().

isCompilable ( )
Returns
bool

Implements ParsedTemplateInterface.

Definition at line 193 of file ParsingState.php.

References ParsingState\$compilable.

isCompiled ( )
Returns
bool

Implements ParsedTemplateInterface.

Definition at line 209 of file ParsingState.php.

popNodeFromStack ( )

Pop the top stack element (=remove it) and return it back.

Returns
the top stack element, which was removed.

Definition at line 115 of file ParsingState.php.

Push a node to the node stack. The node stack holds all currently open templating tags.

Parameters
\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode$nodeNode to push to node stack
Returns
void

Definition at line 95 of file ParsingState.php.

Render the parsed template with rendering context

Parameters
\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface$renderingContextThe rendering context to use
Returns
string Rendered string

Implements ParsedTemplateInterface.

Definition at line 83 of file ParsingState.php.

setCompilable (   $compilable)
Parameters
bool$compilable

Definition at line 201 of file ParsingState.php.

References ParsingState\$compilable.

setLayoutNameNode ( \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode  $layoutNameNode)
Parameters
\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode$layoutNameNodename of the layout that is defined in this template via <f:layout name="..." />
Returns
void

Definition at line 145 of file ParsingState.php.

References ParsingState\$layoutNameNode.

Set root node of this parsing state

Parameters
\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode$rootNode
Returns
void

Definition at line 62 of file ParsingState.php.

References ParsingState\$rootNode.

Member Data Documentation

$compilable = true
protected

Definition at line 54 of file ParsingState.php.

Referenced by ParsingState\isCompilable(), and ParsingState\setCompilable().

$layoutNameNode
protected
$nodeStack = array()
protected

Definition at line 33 of file ParsingState.php.

$rootNode
protected

Definition at line 26 of file ParsingState.php.

Referenced by ParsingState\getRootNode(), and ParsingState\setRootNode().

$variableContainer
protected

Definition at line 42 of file ParsingState.php.

Referenced by ParsingState\getVariableContainer().