PHP Class Neos\Fusion\View\FusionView

Recursively loads all Fusion files from the configured path (By default that's Resources/Private/TypoScripts of the current package) and then checks whether a Fusion object for current controller and action can be found. If the controller class name is Foo\Bar\Baz\Controller\BlahController and the action is "index", it checks for the Fusion path Foo.Bar.Baz.BlahController.index. If this path is found, then it is used for rendering. Otherwise, the $fallbackView is used.
Inheritance: extends Neos\Flow\Mvc\View\AbstractView
Show file Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Property Type Description
$fallbackView Neos\Flow\Mvc\View\ViewInterface
$fallbackViewEnabled boolean if FALSE, the fallback view will never be used.
$parsedTypoScript array The parsed TypoScript array in its internal representation
$supportedOptions array This contains the supported options, their default values, descriptions and types.
$typoScriptParser Neos\Fusion\Core\Parser
$typoScriptPath string Runtime cache of the TypoScript path which should be rendered; derived from the controller and action names or set by the user.
$typoScriptRuntime Neos\Fusion\Core\Runtime The TypoScript Runtime

Public Methods

Method Description
disableFallbackView ( ) : void Disable the use of the Fallback View
enableFallbackView ( ) : void Re-Enable the use of the Fallback View. By default, it is enabled, so calling this method only makes sense if disableFallbackView() has been called before.
initializeTypoScriptRuntime ( ) : void Load the TypoScript Files form the defined paths and construct a Runtime from the parsed results
render ( ) : string Render the view
renderFallbackView ( ) : string Initialize and render the fallback view
setOption ( string $optionName, mixed $value ) : void Reset runtime cache if an option is changed
setPackageKey ( string $packageKey ) : void The package key where the TypoScript should be loaded from. If not given, is automatically derived from the current request.
setTypoScriptPath ( string $typoScriptPath ) : void Sets the TypoScript path to be rendered to an explicit value; to be used mostly inside tests.
setTypoScriptPathPattern ( string $pathPattern ) : void
setTypoScriptPathPatterns ( array $pathPatterns ) : void

Protected Methods

Method Description
getPackageKey ( ) : string Get the package key to load the TypoScript from. If set, $this->getOption('packageKey') is used.
getTypoScriptPathForCurrentRequest ( ) : string Determines the TypoScript path depending on the current controller and action
isTypoScriptFoundForCurrentRequest ( ) : boolean Determine whether we are able to find TypoScript at the requested position
loadTypoScript ( ) : void Load TypoScript from the directories specified by $this->getOption('typoScriptPathPatterns')
renderTypoScript ( ) : string Render the given TypoScript and return the rendered page

Method Details

disableFallbackView() public method

Disable the use of the Fallback View
public disableFallbackView ( ) : void
return void

enableFallbackView() public method

Re-Enable the use of the Fallback View. By default, it is enabled, so calling this method only makes sense if disableFallbackView() has been called before.
public enableFallbackView ( ) : void
return void

getPackageKey() protected method

Otherwise, the current request is taken and the controller package key is extracted from there.
protected getPackageKey ( ) : string
return string the package key to load TypoScript from

getTypoScriptPathForCurrentRequest() protected method

Determines the TypoScript path depending on the current controller and action

initializeTypoScriptRuntime() public method

Load the TypoScript Files form the defined paths and construct a Runtime from the parsed results
public initializeTypoScriptRuntime ( ) : void
return void

isTypoScriptFoundForCurrentRequest() protected method

Determine whether we are able to find TypoScript at the requested position
protected isTypoScriptFoundForCurrentRequest ( ) : boolean
return boolean TRUE if TypoScript exists at the current TypoScript path; FALSE otherwise

loadTypoScript() protected method

Load TypoScript from the directories specified by $this->getOption('typoScriptPathPatterns')
protected loadTypoScript ( ) : void
return void

render() public method

Render the view
public render ( ) : string
return string The rendered view

renderFallbackView() public method

Initialize and render the fallback view
public renderFallbackView ( ) : string
return string

renderTypoScript() protected method

Render the given TypoScript and return the rendered page
protected renderTypoScript ( ) : string
return string

setOption() public method

Reset runtime cache if an option is changed
public setOption ( string $optionName, mixed $value ) : void
$optionName string
$value mixed
return void

setPackageKey() public method

The package key where the TypoScript should be loaded from. If not given, is automatically derived from the current request.
public setPackageKey ( string $packageKey ) : void
$packageKey string
return void

setTypoScriptPath() public method

Sets the TypoScript path to be rendered to an explicit value; to be used mostly inside tests.
public setTypoScriptPath ( string $typoScriptPath ) : void
$typoScriptPath string
return void

setTypoScriptPathPattern() public method

public setTypoScriptPathPattern ( string $pathPattern ) : void
$pathPattern string
return void

setTypoScriptPathPatterns() public method

public setTypoScriptPathPatterns ( array $pathPatterns ) : void
$pathPatterns array
return void

Property Details

$fallbackView protected property

protected ViewInterface,Neos\Flow\Mvc\View $fallbackView
return Neos\Flow\Mvc\View\ViewInterface

$fallbackViewEnabled protected property

if FALSE, the fallback view will never be used.
protected bool $fallbackViewEnabled
return boolean

$parsedTypoScript protected property

The parsed TypoScript array in its internal representation
protected array $parsedTypoScript
return array

$supportedOptions protected property

This contains the supported options, their default values, descriptions and types.
protected array $supportedOptions
return array

$typoScriptParser protected property

protected Parser,Neos\Fusion\Core $typoScriptParser
return Neos\Fusion\Core\Parser

$typoScriptPath protected property

Runtime cache of the TypoScript path which should be rendered; derived from the controller and action names or set by the user.
protected string $typoScriptPath
return string

$typoScriptRuntime protected property

The TypoScript Runtime
protected Runtime,Neos\Fusion\Core $typoScriptRuntime
return Neos\Fusion\Core\Runtime