TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Fluid\Core\Parser\ParsingState Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\Core\Parser\ParsingState:
TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface Tx_Fluid_Core_Parser_ParsingState

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()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::countNodeStack ( )

Count the size of the node stack

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

Definition at line 119 of file ParsingState.php.

◆ getLayoutName()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::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

Implements TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface.

Definition at line 167 of file ParsingState.php.

References TYPO3\CMS\Fluid\Core\Parser\ParsingState\hasLayout().

◆ getLayoutNameNode()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::getLayoutNameNode ( )
Returns

Definition at line 144 of file ParsingState.php.

References TYPO3\CMS\Fluid\Core\Parser\ParsingState\$layoutNameNode.

◆ getNodeFromStack()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::getNodeFromStack ( )

Get the top stack element, without removing it.

Returns
the top stack element.

Definition at line 101 of file ParsingState.php.

◆ getRootNode()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::getRootNode ( )

Get root node of this parsing state.

Returns
The root node

Definition at line 71 of file ParsingState.php.

References TYPO3\CMS\Fluid\Core\Parser\ParsingState\$rootNode.

◆ getVariableContainer()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::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 TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface.

Definition at line 129 of file ParsingState.php.

References TYPO3\CMS\Fluid\Core\Parser\ParsingState\$variableContainer.

◆ hasLayout()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::hasLayout ( )

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

See also
getLayoutName()
Returns
boolean

Implements TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface.

Definition at line 154 of file ParsingState.php.

Referenced by TYPO3\CMS\Fluid\Core\Parser\ParsingState\getLayoutName().

◆ isCompilable()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::isCompilable ( )

◆ isCompiled()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::isCompiled ( )
Returns
boolean

Implements TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface.

Definition at line 195 of file ParsingState.php.

◆ popNodeFromStack()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::popNodeFromStack ( )

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

Returns
the top stack element, which was removed.

Definition at line 110 of file ParsingState.php.

◆ pushNodeToStack()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::pushNodeToStack ( \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode  $node)

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 92 of file ParsingState.php.

◆ render()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::render ( \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface  $renderingContext)

Render the parsed template with rendering context

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

Implements TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface.

Definition at line 81 of file ParsingState.php.

◆ setCompilable()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::setCompilable (   $compilable)
Parameters
boolean$compilable

Definition at line 188 of file ParsingState.php.

References TYPO3\CMS\Fluid\Core\Parser\ParsingState\$compilable.

◆ setLayoutNameNode()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::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 137 of file ParsingState.php.

References TYPO3\CMS\Fluid\Core\Parser\ParsingState\$layoutNameNode.

◆ setRootNode()

TYPO3\CMS\Fluid\Core\Parser\ParsingState::setRootNode ( \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode  $rootNode)

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 TYPO3\CMS\Fluid\Core\Parser\ParsingState\$rootNode.

Member Data Documentation

◆ $compilable

TYPO3\CMS\Fluid\Core\Parser\ParsingState::$compilable = TRUE
protected

◆ $layoutNameNode

TYPO3\CMS\Fluid\Core\Parser\ParsingState::$layoutNameNode
protected

◆ $nodeStack

TYPO3\CMS\Fluid\Core\Parser\ParsingState::$nodeStack = array()
protected

Definition at line 33 of file ParsingState.php.

◆ $rootNode

TYPO3\CMS\Fluid\Core\Parser\ParsingState::$rootNode
protected

◆ $variableContainer

TYPO3\CMS\Fluid\Core\Parser\ParsingState::$variableContainer
protected