PHP Класс Neos\Fusion\Core\Runtime

TypoScript Rendering Process ============================ During rendering, all TypoScript objects form a tree. When a TypoScript object at a certain $typoScriptPath is invoked, it has access to all variables stored in the $context (which is an array). The TypoScript object can then add or replace variables to this context using pushContext() or pushContextArray(), before rendering sub-TypoScript objects. After rendering these, it must call popContext() to reset the context to the last state.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$configurationOnPathRuntimeCache array
$controllerContext Neos\Flow\Mvc\Controller\ControllerContext
$debugMode boolean
$defaultContextVariables array Default context with helper definitions
$eelEvaluator Neos\Eel\CompilingEvaluator
$lastEvaluationStatus string
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$renderingStack array Contains list of contexts
$runtimeContentCache Neos\Fusion\Core\Cache\RuntimeContentCache
$settings array
$simpleTypeToArrayClosure Closure
$typoScriptConfiguration array

Открытые методы

Метод Описание
__construct ( array $typoScriptConfiguration, ControllerContext $controllerContext ) Constructor for the TypoScript Runtime
addCacheTag ( string $key, string $value ) : void Add a tag to the current cache segment
canRender ( string $typoScriptPath ) : boolean Determine if the given TypoScript path is renderable, which means it exists and has an implementation.
evaluate ( string $typoScriptPath, object $contextObject = null ) : mixed Evaluate an absolute TypoScript path and return the result
getControllerContext ( ) : ControllerContext Returns the context which has been passed by the currently active MVC Controller
getCurrentContext ( ) : array Get the current context array
getLastEvaluationStatus ( ) : string
handleRenderingException ( array $typoScriptPath, Exception $exception, boolean $useInnerExceptionHandler = false ) : string Handle an Exception thrown while rendering TypoScript according to settings specified in Neos.Fusion.rendering.exceptionHandler
injectSettings ( array $settings ) : void Inject settings of this package
isDebugMode ( ) : boolean
popContext ( ) : array Remove the topmost context objects and return them
pushContext ( string $key, mixed $context ) : void Push a new context object to the rendering stack
pushContextArray ( array $contextArray ) : void Completely replace the context array with the new $contextArray.
render ( string $typoScriptPath ) : string Render an absolute TypoScript path and return the result.
setDebugMode ( boolean $debugMode ) : void
setEnableContentCache ( boolean $flag ) : void If the TypoScript content cache should be enabled at all

Защищенные методы

Метод Описание
canRenderWithConfiguration ( array $typoScriptConfiguration ) : boolean Internal evaluation if given configuration is renderable.
evaluateEelExpression ( string $expression, AbstractTypoScriptObject $contextObject = null ) : mixed Evaluate an Eel expression
evaluateEelExpressionOrSimpleValueWithProcessor ( string $typoScriptPath, array $valueConfiguration, AbstractTypoScriptObject $contextObject = null ) : mixed Evaluate a simple value or eel expression with processors
evaluateIfCondition ( array $configurationWithEventualIf, string $configurationPath, AbstractTypoScriptObject $contextObject = null ) : boolean Evaluate eventually existing meta "@if" conditionals inside the given configuration and path.
evaluateInternal ( string $typoScriptPath, string $behaviorIfPathNotFound, mixed $contextObject = null ) : mixed Internal evaluation method of absolute $typoScriptPath
evaluateObjectOrRetrieveFromCache ( AbstractTypoScriptObject $typoScriptObject, string $typoScriptPath, array $typoScriptConfiguration, array $cacheContext ) : mixed Does the evaluation of a TypoScript instance, first checking the cache and if conditions and afterwards applying processors.
evaluateProcessors ( mixed $valueToProcess, array $configurationWithEventualProcessors, string $typoScriptPath, AbstractTypoScriptObject $contextObject = null ) : mixed Evaluate processors on given value.
evaluteExpressionOrValueInternal ( string $typoScriptPath, array $typoScriptConfiguration, array $cacheContext, mixed $contextObject ) : mixed Evaluates an EEL expression or value, checking if conditions first and applying processors.
finalizePathEvaluation ( array $cacheContext, boolean $needToPopContext = false ) : void Ends the evaluation of a typoscript path by popping the context stack if needed and leaving the cache context.
getConfigurationForPath ( string $typoScriptPath ) : array Get the TypoScript Configuration for the given TypoScript path
getDefaultContextVariables ( ) : array Get variables from configuration that should be set in the context by default.
hasExpressionOrValue ( array $typoScriptConfiguration ) : boolean Does the given TypoScript configuration array hold an EEL expression or simple value.
instantiateTypoScriptObject ( string $typoScriptPath, array $typoScriptConfiguration ) : AbstractTypoScriptObject Instantiates a TypoScript object specified by the given path and configuration
isArrayTypoScriptObject ( AbstractTypoScriptObject $typoScriptObject ) : boolean Check if the given object is an array like object that should get all properties set to iterate or process internally.
matchCurrentPathPart ( string $pathPart, array $previousConfiguration, array &$currentPrototypeDefinitions ) : array Matches the current path segment and prepares the configuration.
mergePrototypesWithConfigurationForPathSegment ( array $configuration, array &$currentPrototypeDefinitions ) : array Merges the prototype chain into the configuration.
prepareContextForTypoScriptObject ( AbstractTypoScriptObject $typoScriptObject, string $typoScriptPath, array $typoScriptConfiguration, array $cacheContext ) : boolean Possibly prepares a new context for the current TypoScriptObject and cache context and pushes it to the stack.
setPropertiesOnTypoScriptObject ( AbstractArrayTypoScriptObject $typoScriptObject, array $typoScriptConfiguration ) : void Set options on the given (AbstractArray)TypoScript object
throwExceptionForUnrenderablePathIfNeeded ( string $typoScriptPath, array $typoScriptConfiguration, string $behaviorIfPathNotFound ) Checks and throws an exception for an unrenderable path.

Описание методов

__construct() публичный Метод

Constructor for the TypoScript Runtime
public __construct ( array $typoScriptConfiguration, ControllerContext $controllerContext )
$typoScriptConfiguration array
$controllerContext Neos\Flow\Mvc\Controller\ControllerContext

addCacheTag() публичный Метод

During TS rendering the method can be used to add tag dynamicaly for the current cache segment.
public addCacheTag ( string $key, string $value ) : void
$key string
$value string
Результат void

canRender() публичный Метод

Determine if the given TypoScript path is renderable, which means it exists and has an implementation.
public canRender ( string $typoScriptPath ) : boolean
$typoScriptPath string
Результат boolean

canRenderWithConfiguration() защищенный Метод

Internal evaluation if given configuration is renderable.
protected canRenderWithConfiguration ( array $typoScriptConfiguration ) : boolean
$typoScriptConfiguration array
Результат boolean

evaluate() публичный Метод

Evaluate an absolute TypoScript path and return the result
public evaluate ( string $typoScriptPath, object $contextObject = null ) : mixed
$typoScriptPath string
$contextObject object the object available as "this" in Eel expressions. ONLY FOR INTERNAL USE!
Результат mixed the result of the evaluation, can be a string but also other data types

evaluateEelExpression() защищенный Метод

Evaluate an Eel expression
protected evaluateEelExpression ( string $expression, AbstractTypoScriptObject $contextObject = null ) : mixed
$expression string The Eel expression to evaluate
$contextObject Neos\Fusion\TypoScriptObjects\AbstractTypoScriptObject An optional object for the "this" value inside the context
Результат mixed The result of the evaluated Eel expression

evaluateEelExpressionOrSimpleValueWithProcessor() защищенный Метод

Evaluate a simple value or eel expression with processors
protected evaluateEelExpressionOrSimpleValueWithProcessor ( string $typoScriptPath, array $valueConfiguration, AbstractTypoScriptObject $contextObject = null ) : mixed
$typoScriptPath string the TypoScript path up to now
$valueConfiguration array TypoScript configuration for the value
$contextObject Neos\Fusion\TypoScriptObjects\AbstractTypoScriptObject An optional object for the "this" value inside the context
Результат mixed The result of the evaluation

evaluateIfCondition() защищенный Метод

Evaluate eventually existing meta "@if" conditionals inside the given configuration and path.
protected evaluateIfCondition ( array $configurationWithEventualIf, string $configurationPath, AbstractTypoScriptObject $contextObject = null ) : boolean
$configurationWithEventualIf array
$configurationPath string
$contextObject Neos\Fusion\TypoScriptObjects\AbstractTypoScriptObject
Результат boolean

evaluateInternal() защищенный Метод

Internal evaluation method of absolute $typoScriptPath
protected evaluateInternal ( string $typoScriptPath, string $behaviorIfPathNotFound, mixed $contextObject = null ) : mixed
$typoScriptPath string
$behaviorIfPathNotFound string one of BEHAVIOR_EXCEPTION or BEHAVIOR_RETURNNULL
$contextObject mixed the object which will be "this" in Eel expressions, if any
Результат mixed

evaluateObjectOrRetrieveFromCache() защищенный Метод

Does the evaluation of a TypoScript instance, first checking the cache and if conditions and afterwards applying processors.
protected evaluateObjectOrRetrieveFromCache ( AbstractTypoScriptObject $typoScriptObject, string $typoScriptPath, array $typoScriptConfiguration, array $cacheContext ) : mixed
$typoScriptObject Neos\Fusion\TypoScriptObjects\AbstractTypoScriptObject
$typoScriptPath string
$typoScriptConfiguration array
$cacheContext array
Результат mixed

evaluateProcessors() защищенный Метод

Evaluate processors on given value.
protected evaluateProcessors ( mixed $valueToProcess, array $configurationWithEventualProcessors, string $typoScriptPath, AbstractTypoScriptObject $contextObject = null ) : mixed
$valueToProcess mixed
$configurationWithEventualProcessors array
$typoScriptPath string
$contextObject Neos\Fusion\TypoScriptObjects\AbstractTypoScriptObject
Результат mixed

evaluteExpressionOrValueInternal() защищенный Метод

Evaluates an EEL expression or value, checking if conditions first and applying processors.
protected evaluteExpressionOrValueInternal ( string $typoScriptPath, array $typoScriptConfiguration, array $cacheContext, mixed $contextObject ) : mixed
$typoScriptPath string
$typoScriptConfiguration array
$cacheContext array
$contextObject mixed
Результат mixed

finalizePathEvaluation() защищенный Метод

Ends the evaluation of a typoscript path by popping the context stack if needed and leaving the cache context.
protected finalizePathEvaluation ( array $cacheContext, boolean $needToPopContext = false ) : void
$cacheContext array
$needToPopContext boolean
Результат void

getConfigurationForPath() защищенный Метод

Get the TypoScript Configuration for the given TypoScript path
protected getConfigurationForPath ( string $typoScriptPath ) : array
$typoScriptPath string
Результат array

getControllerContext() публичный Метод

Returns the context which has been passed by the currently active MVC Controller
public getControllerContext ( ) : ControllerContext
Результат Neos\Flow\Mvc\Controller\ControllerContext

getCurrentContext() публичный Метод

Get the current context array
public getCurrentContext ( ) : array
Результат array the array of current context objects

getDefaultContextVariables() защищенный Метод

For example Eel helpers are made available by this.
protected getDefaultContextVariables ( ) : array
Результат array Array with default context variable objects.

getLastEvaluationStatus() публичный Метод

public getLastEvaluationStatus ( ) : string
Результат string

handleRenderingException() публичный Метод

Handle an Exception thrown while rendering TypoScript according to settings specified in Neos.Fusion.rendering.exceptionHandler
public handleRenderingException ( array $typoScriptPath, Exception $exception, boolean $useInnerExceptionHandler = false ) : string
$typoScriptPath array
$exception Exception
$useInnerExceptionHandler boolean
Результат string

hasExpressionOrValue() защищенный Метод

Does the given TypoScript configuration array hold an EEL expression or simple value.
protected hasExpressionOrValue ( array $typoScriptConfiguration ) : boolean
$typoScriptConfiguration array
Результат boolean

injectSettings() публичный Метод

Inject settings of this package
public injectSettings ( array $settings ) : void
$settings array The settings
Результат void

instantiateTypoScriptObject() защищенный Метод

Instantiates a TypoScript object specified by the given path and configuration
protected instantiateTypoScriptObject ( string $typoScriptPath, array $typoScriptConfiguration ) : AbstractTypoScriptObject
$typoScriptPath string Path to the configuration for this object instance
$typoScriptConfiguration array Configuration at the given path
Результат Neos\Fusion\TypoScriptObjects\AbstractTypoScriptObject

isArrayTypoScriptObject() защищенный Метод

Check if the given object is an array like object that should get all properties set to iterate or process internally.
protected isArrayTypoScriptObject ( AbstractTypoScriptObject $typoScriptObject ) : boolean
$typoScriptObject Neos\Fusion\TypoScriptObjects\AbstractTypoScriptObject
Результат boolean

isDebugMode() публичный Метод

public isDebugMode ( ) : boolean
Результат boolean

matchCurrentPathPart() защищенный Метод

Matches the current path segment and prepares the configuration.
protected matchCurrentPathPart ( string $pathPart, array $previousConfiguration, array &$currentPrototypeDefinitions ) : array
$pathPart string
$previousConfiguration array
$currentPrototypeDefinitions array
Результат array

mergePrototypesWithConfigurationForPathSegment() защищенный Метод

Merges the prototype chain into the configuration.
protected mergePrototypesWithConfigurationForPathSegment ( array $configuration, array &$currentPrototypeDefinitions ) : array
$configuration array
$currentPrototypeDefinitions array
Результат array

popContext() публичный Метод

Remove the topmost context objects and return them
public popContext ( ) : array
Результат array the topmost context objects as associative array

prepareContextForTypoScriptObject() защищенный Метод

Returns if a new context was pushed to the stack or not.
protected prepareContextForTypoScriptObject ( AbstractTypoScriptObject $typoScriptObject, string $typoScriptPath, array $typoScriptConfiguration, array $cacheContext ) : boolean
$typoScriptObject Neos\Fusion\TypoScriptObjects\AbstractTypoScriptObject
$typoScriptPath string
$typoScriptConfiguration array
$cacheContext array
Результат boolean

pushContext() публичный Метод

Push a new context object to the rendering stack
public pushContext ( string $key, mixed $context ) : void
$key string the key inside the context
$context mixed
Результат void

pushContextArray() публичный Метод

Purely internal method, should not be called outside of Neos.Fusion.
public pushContextArray ( array $contextArray ) : void
$contextArray array
Результат void

render() публичный Метод

Compared to $this->evaluate, this adds some more comments helpful for debugging.
public render ( string $typoScriptPath ) : string
$typoScriptPath string
Результат string

setDebugMode() публичный Метод

public setDebugMode ( boolean $debugMode ) : void
$debugMode boolean
Результат void

setEnableContentCache() публичный Метод

If the TypoScript content cache should be enabled at all
public setEnableContentCache ( boolean $flag ) : void
$flag boolean
Результат void

setPropertiesOnTypoScriptObject() защищенный Метод

Set options on the given (AbstractArray)TypoScript object
protected setPropertiesOnTypoScriptObject ( AbstractArrayTypoScriptObject $typoScriptObject, array $typoScriptConfiguration ) : void
$typoScriptObject Neos\Fusion\TypoScriptObjects\AbstractArrayTypoScriptObject
$typoScriptConfiguration array
Результат void

throwExceptionForUnrenderablePathIfNeeded() защищенный Метод

Checks and throws an exception for an unrenderable path.
protected throwExceptionForUnrenderablePathIfNeeded ( string $typoScriptPath, array $typoScriptConfiguration, string $behaviorIfPathNotFound )
$typoScriptPath string The TypoScript path that cannot be rendered
$typoScriptConfiguration array
$behaviorIfPathNotFound string One of the BEHAVIOR_* constants

Описание свойств

$configurationOnPathRuntimeCache защищенное свойство

protected array $configurationOnPathRuntimeCache
Результат array

$controllerContext защищенное свойство

protected ControllerContext,Neos\Flow\Mvc\Controller $controllerContext
Результат Neos\Flow\Mvc\Controller\ControllerContext

$debugMode защищенное свойство

protected bool $debugMode
Результат boolean

$defaultContextVariables защищенное свойство

Default context with helper definitions
protected array $defaultContextVariables
Результат array

$eelEvaluator защищенное свойство

protected CompilingEvaluator,Neos\Eel $eelEvaluator
Результат Neos\Eel\CompilingEvaluator

$lastEvaluationStatus защищенное свойство

protected string $lastEvaluationStatus
Результат string

$objectManager защищенное свойство

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
Результат Neos\Flow\ObjectManagement\ObjectManagerInterface

$renderingStack защищенное свойство

Contains list of contexts
protected array $renderingStack
Результат array

$runtimeContentCache защищенное свойство

protected RuntimeContentCache,Neos\Fusion\Core\Cache $runtimeContentCache
Результат Neos\Fusion\Core\Cache\RuntimeContentCache

$settings защищенное свойство

protected array $settings
Результат array

$simpleTypeToArrayClosure защищенное свойство

protected Closure $simpleTypeToArrayClosure
Результат Closure

$typoScriptConfiguration защищенное свойство

protected array $typoScriptConfiguration
Результат array