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 array | $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 |
Methods
Reset runtime cache if an option is changed
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
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 the 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
Render the given Fusion and return the rendered page
Details
void
setOption(string $optionName, mixed $value)
Reset runtime cache if an option is changed
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
mixed
render()
Render the view
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 array
getMergedFusionObjectTree()
Parse all the fusion files the 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
protected mixed
renderFusion()
Render the given Fusion and return the rendered page