FusionView
class FusionView extends AbstractView (View source)
View for using Fusion for standard MVC controllers.
Recursively loads all Fusion files from the configured path (By default that's Resources/Private/Fusion 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.
Properties
| protected array | $supportedOptions | This contains the supported options, their default values, descriptions and types. |
|
| protected Parser | $fusionParser | ||
| protected FusionConfiguration | $parsedFusion | The parsed Fusion array in its internal representation |
|
| protected string | $fusionPath | Runtime cache of the Fusion path which should be rendered; derived from the controller and action names or set by the user. |
|
| protected RuntimeFactory | $runtimeFactory | ||
| protected Runtime | $fusionRuntime | The Fusion Runtime |
|
| protected ActionRequest|null | $assignedActionRequest | Via {assign} request using the "request" key, will be available also as Fusion global in the runtime. |
Methods
Reset runtime cache if an option is changed
No description
Legacy layer to set the request for this view if not set already.
Sets the Fusion path to be rendered to an explicit value; to be used mostly inside tests.
The package key where the Fusion should be loaded from. If not given, is automatically derived from the current request.
No description
No description
Render the view to a full response in case a Neos.Fusion:Http.Message was used.
Load the Fusion Files form the defined paths and construct a Runtime from the parsed results
Load Fusion from the directories specified by $this->getOption('fusionPathPatterns')
Parse all the fusion files that are in the current fusionPathPatterns
Get the currently configured fusion path patterns
@package is replaced by the current package key
Get the package key to load the Fusion from. If set, $this->getOption('packageKey') is used.
Determines the Fusion path depending on the current controller and action
Details
void
setOption(string $optionName, mixed $value)
Reset runtime cache if an option is changed
FusionView
assign(string $key, mixed $value)
No description
setControllerContext(ControllerContext $controllerContext)
deprecated
deprecated
Legacy layer to set the request for this view if not set already.
Please use {\Neos\Fusion\View\assign} with "request" instead
$view->assign('request"', $this->request)
void
setFusionPath(string $fusionPath)
Sets the Fusion path to be rendered to an explicit value; to be used mostly inside tests.
void
setPackageKey(string $packageKey)
The package key where the Fusion should be loaded from. If not given, is automatically derived from the current request.
void
setFusionPathPattern(string $pathPattern)
No description
void
setFusionPathPatterns(array $pathPatterns)
No description
ResponseInterface|StreamInterface
render()
Render the view to a full response in case a Neos.Fusion:Http.Message was used.
If the fusion path contains a simple string a stream will be rendered.
void
initializeFusionRuntime()
Load the Fusion Files form the defined paths and construct a Runtime from the parsed results
protected void
loadFusion()
Load Fusion from the directories specified by $this->getOption('fusionPathPatterns')
protected FusionConfiguration
getMergedFusionObjectTree()
Parse all the fusion files that are in the current fusionPathPatterns
array
getFusionPathPatterns()
Get the currently configured fusion path patterns
@package is replaced by the current package key
protected string
getPackageKey()
Get the package key to load the Fusion from. If set, $this->getOption('packageKey') is used.
Otherwise, the current request is taken and the controller package key is extracted from there.
protected string
getFusionPathForCurrentRequest()
Determines the Fusion path depending on the current controller and action