final class FusionGlobals (View source)

internal  The globals will be set inside the FusionView as declared
 

Fusion differentiates between dynamic context variables and fixed Fusion globals.

Context variables are allowed to be set via Fusion's \@context.foo = "bar" or by leveraging the php api {[\Neos\Fusion\Core\Runtime::pushContext()}.

Context](../../../Neos/Fusion/Core/Runtime.html) variables are highly dynamic and don't guarantee the existence of a specific variables, as they have to be explicitly preserved in uncached \@cache segments, or might accidentally be popped from the stack.

The Fusion globals are immutable and part of the runtime's constructor. A fixed set of global variables which might contain the EEL helper definitions or functions like FlowQuery can be passed this way.

Additionally, also special variables like "request" are made available.

The speciality with "request" and similar is that they should be always available but never cached. Regular context variables must be serialized to be available in uncached segments, but the current request must not be serialized into the cache as it contains user specific information. This is avoided by always exposing the current action request via the global variable.

Overriding Fusion globals is disallowed via \@context and {[\Neos\Fusion\Core\Runtime::pushContext()}.

Fusion](../../../Neos/Fusion/Core/Runtime.html) globals are case-sensitive, though it's not recommend to leverage this behaviour.

Methods

static FusionGlobals
createEmpty()

No description

static FusionGlobals
fromArray(array $variables)

No description

mixed
get(string $name)

Access the possible current request or other globals:

bool
has(string $name)

No description

merge(FusionGlobals $other)

No description

Details

static FusionGlobals createEmpty()

No description

Return Value

FusionGlobals

static FusionGlobals fromArray(array $variables)

No description

Parameters

array $variables

Return Value

FusionGlobals

mixed get(string $name)

Access the possible current request or other globals:

$actionRequest = $this->runtime->fusionGlobals->get('request'); if (!$actionRequest instanceof ActionRequest) { // fallback or error }

Parameters

string $name

Return Value

mixed

bool has(string $name)

No description

Parameters

string $name

Return Value

bool

FusionGlobals merge(FusionGlobals $other)

No description

Parameters

FusionGlobals $other

Return Value

FusionGlobals