class Factory implements Factory

Traits

Constants

protected RENDER_COUNT_CONTEXT_KEY

The number of active rendering operations.

protected RENDERED_ONCE_CONTEXT_KEY

The "once" block IDs that have been rendered.

Properties

static protected array $macros

The registered string macros.

from  Macroable
protected Container $container

The IoC container instance.

protected array $shared

Data that should be available to all templates.

protected array $extensions

The extension to engine bindings.

protected array $composers

The view composer events.

protected array $pathEngineCache

The cached array of engines for paths.

protected array $normalizedNameCache

The cache of normalized names for views.

protected array $renderingObservers

The registered pre-render observers.

Methods

static void
macro(string $name, callable|object $macro)

Register a custom macro.

static void
mixin(object $mixin, bool $replace = true)

Mix another object into the class.

static bool
hasMacro(string $name)

Check if macro is registered.

static void
flushMacros()

Flush the existing macros.

static mixed
__callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

mixed
__call(string $method, array $parameters)

Dynamically handle calls to the class.

void
startComponent(View|Htmlable|Closure|string $view, array $data = [])

Start a component rendering process.

int
pushComponentStack(View|Htmlable|Closure|string $view)

No description

View|Htmlable|Closure|string|null
popComponentStack()

No description

void
appendComponentData(array $data)

No description

createSlotContext()

No description

void
startComponentFirst(array $names, array $data = [])

Get the first view that actually exists from the given list, and start a component.

string
renderComponent()

Render the current component.

array
componentData()

Get the data for the given component.

mixed
getConsumableComponentData(string $key, mixed $default = null)

Get an item from the component data that exists above the current component.

void
slot(string $name, string|null $content = null, array $attributes = [])

Start the slot rendering process.

void
setSlotData(string $name, string|ComponentSlot|null $content)

No description

void
pushSlotStack(array $value)

No description

array
popSlotStack()

No description

void
endSlot()

Save the slot content for rendering.

int
currentComponent()

Get the index for the current component.

void
flushComponents()

Flush all of the component state.

array
creator(array|string $views, Closure|string $callback)

Register a view creator event.

array
composers(array $composers)

Register multiple view composers via an array.

array
composer(array|string $views, Closure|string $callback)

Register a view composer event.

Closure|null
addViewEvent(string $view, Closure|string $callback, string $prefix = 'composing: ')

Add an event for a given view.

addClassEvent(string $view, string $class, string $prefix)

Register a class based view composer.

buildClassEventCallback(string $class, string $prefix)

Build a class based container callback Closure.

array
parseClassEvent(string $class, string $prefix)

Parse a class based composer name.

string
classEventMethodForPrefix(string $prefix)

Determine the class event method based on the given prefix.

void
addEventListener(string $name, Closure $callback)

Add a listener to the event dispatcher.

void
callComposer(View $view)

Call the composer for a given view.

void
callCreator(View $view)

Call the creator for a given view.

void
startFragment(string $fragment)

Start injecting content into a fragment.

void
pushFragmentStack(string $fragment)

No description

string
stopFragment()

Stop injecting content into a fragment.

mixed
getFragment(string $name, string|null $default = null)

Get the contents of a fragment.

array
getFragments()

Get the entire array of rendered fragments.

void
flushFragments()

Flush all of the fragments.

void
startSection(string $section, string|View|null $content = null)

Start injecting content into a section.

void
inject(string $section, string $content)

Inject inline content into a section.

string
yieldSection()

Stop injecting content into a section and return its contents.

string
stopSection(bool $overwrite = false)

Stop injecting content into a section.

string
appendSection()

Stop injecting content into a section and append it.

void
extendSection(string $section, string $content)

Append content to a given section.

string
yieldContent(string $section, string|View $default = '')

Get the string contents of a section.

string
getParentPlaceholder(string $section = '')

Get the parent placeholder for the current request.

bool
hasSection(string $name)

Check if section exists.

bool
sectionMissing(string $name)

Check if section does not exist.

mixed
getSection(string $name, string|null $default = null)

Get the contents of a section.

array
getSections()

Get the entire array of sections.

void
flushSections()

Flush all of the sections.

void
addLoop(mixed $data)

Add new loop to the stack.

void
incrementLoopIndices()

Increment the top loop's indices.

void
popLoop()

Pop a loop from the top of the loop stack.

stdClass|null
getLastLoop()

Get an instance of the last loop in the stack.

array
getLoopStack()

Get the entire loop stack.

void
startPush(string $section, string $content = '')

Start injecting content into a push section.

void
pushStack(string $section)

No description

string
stopPush()

Stop injecting content into a push section.

void
extendPush(string $section, string $content)

Append content to a given push section.

void
startPrepend(string $section, string $content = '')

Start prepending content into a push section.

string
stopPrepend()

Stop prepending content into a push section.

void
extendPrepend(string $section, string $content)

Prepend content to a given stack.

string
yieldPushContent(string $section, string $default = '')

Get the string contents of a push section.

bool
isStackEmpty(string $section)

Determine if the given stack is empty.

void
flushStacks()

Flush all of the stacks.

void
startTranslation(array $replacements = [])

Start a translation block.

string
renderTranslation()

Render the current translation.

__construct(EngineResolver $engines, ViewFinderInterface $finder, Dispatcher $events)

Create a new view factory instance.

void
__clone()

Clone the factory for isolated render-time namespace changes.

file(string $path, Arrayable|array $data = [], array $mergeData = [])

Get the evaluated view contents for the given view.

make(string $view, Arrayable|array $data = [], array $mergeData = [])

Get the evaluated view contents for the given view.

first(array $views, Arrayable|array $data = [], array $mergeData = [])

Get the first view that actually exists from the given list.

string
renderWhen(bool $condition, string $view, Arrayable|array $data = [], array $mergeData = [])

Get the rendered content of the view based on a given condition.

string
renderUnless(bool $condition, string $view, Arrayable|array $data = [], array $mergeData = [])

Get the rendered content of the view based on the negation of a given condition.

string
renderEach(string $view, array $data, string $iterator, string $empty = 'raw|')

Get the rendered contents of a partial from a loop.

string
normalizeName(string $name)

Normalize a view name.

array
parseData(mixed $data)

Parse the given data into a raw array.

viewInstance(string $view, string $path, Arrayable|array $data)

Create a new view instance from the given arguments.

bool
exists(string $view)

Determine if a given view exists.

getEngineFromPath(string $path)

Get the appropriate view engine for the given path.

string|null
getExtension(string $path)

Get the extension used by the view file.

mixed
share(array|string $key, mixed $value = null)

Add a piece of shared data to the environment.

void
incrementRender()

Increment the rendering counter.

void
decrementRender()

Decrement the rendering counter.

void
observeRendering(callable $observer)

Register a pre-render observer.

void
notifyRendering(View $view)

Notify pre-render observers that a view is about to render.

int
getRenderCount()

Get the rendering counter.

bool
doneRendering()

Check if there are no active render operations.

bool
hasRenderedOnce(string $id)

Determine if the given once token has been rendered.

void
markAsRenderedOnce(string $id)

Mark the given once token as having been rendered.

void
addLocation(string $location)

Add a location to the array of view locations.

void
prependLocation(string $location)

Prepend a location to the array of view locations.

addNamespace(string $namespace, string|array $hints)

Add a new namespace to the loader.

prependNamespace(string $namespace, string|array $hints)

Prepend a new namespace to the loader.

replaceNamespace(string $namespace, string|array $hints)

Replace the namespace hints for the given namespace.

void
addExtension(string $extension, string $engine, Closure|null $resolver = null)

Register a valid view extension and its engine.

void
flushState()

Flush all of the factory state like sections and stacks.

void
flushStateIfDoneRendering()

Flush all of the section contents if done rendering.

array
getExtensions()

Get the extension to engine bindings.

getEngineResolver()

Get the engine resolver instance.

getFinder()

Get the view finder instance.

void
setFinder(ViewFinderInterface $finder)

Set the view finder instance.

void
flushFinderCache()

Flush the cache of views located by the finder.

getDispatcher()

Get the event dispatcher instance.

void
setDispatcher(Dispatcher $events)

Set the event dispatcher instance.

getContainer()

Get the IoC container instance.

void
setContainer(Container $container)

Set the IoC container instance.

mixed
shared(string $key, mixed $default = null)

Get an item from the shared data.

array
getShared()

Get all of the shared data for the environment.

array
mergeSharedData(array $data)

Merge shared data into the given view data.

Details

in Macroable at line 28
static void macro(string $name, callable|object $macro)

Register a custom macro.

Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.

Parameters

string $name
callable|object $macro

Return Value

void

in Macroable at line 41
static void mixin(object $mixin, bool $replace = true)

Mix another object into the class.

Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

in Macroable at line 57
static bool hasMacro(string $name)

Check if macro is registered.

Parameters

string $name

Return Value

bool

in Macroable at line 68
static void flushMacros()

Flush the existing macros.

Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.

Return Value

void

in Macroable at line 78
static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in Macroable at line 103
mixed __call(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in ManagesComponents at line 44
void startComponent(View|Htmlable|Closure|string $view, array $data = [])

Start a component rendering process.

Parameters

View|Htmlable|Closure|string $view
array $data

Return Value

void

in ManagesComponents at line 55
protected int pushComponentStack(View|Htmlable|Closure|string $view)

No description

Parameters

View|Htmlable|Closure|string $view

Return Value

int

in ManagesComponents at line 64
protected View|Htmlable|Closure|string|null popComponentStack()

No description

Return Value

View|Htmlable|Closure|string|null

in ManagesComponents at line 73
protected void appendComponentData(array $data)

No description

Parameters

array $data

Return Value

void

in ManagesComponents at line 80
protected createSlotContext()

No description

in ManagesComponents at line 90
void startComponentFirst(array $names, array $data = [])

Get the first view that actually exists from the given list, and start a component.

Parameters

array $names
array $data

Return Value

void

in ManagesComponents at line 102
string renderComponent()

Render the current component.

Return Value

string

in ManagesComponents at line 130
protected array componentData()

Get the data for the given component.

Return Value

array

in ManagesComponents at line 155
mixed getConsumableComponentData(string $key, mixed $default = null)

Get an item from the component data that exists above the current component.

Parameters

string $key
mixed $default

Return Value

mixed

in ManagesComponents at line 186
void slot(string $name, string|null $content = null, array $attributes = [])

Start the slot rendering process.

Parameters

string $name
string|null $content
array $attributes

Return Value

void

in ManagesComponents at line 197
protected void setSlotData(string $name, string|ComponentSlot|null $content)

No description

Parameters

string $name
string|ComponentSlot|null $content

Return Value

void

in ManagesComponents at line 206
protected void pushSlotStack(array $value)

No description

Parameters

array $value

Return Value

void

in ManagesComponents at line 215
protected array popSlotStack()

No description

Return Value

array

in ManagesComponents at line 229
void endSlot()

Save the slot content for rendering.

Return Value

void

in ManagesComponents at line 244
protected int currentComponent()

Get the index for the current component.

Return Value

int

in ManagesComponents at line 253
protected void flushComponents()

Flush all of the component state.

Return Value

void

in ManagesEvents at line 19
array creator(array|string $views, Closure|string $callback)

Register a view creator event.

Boot-only. The listener persists on the singleton View Factory's event dispatcher for the worker lifetime and affects every subsequent request.

Parameters

array|string $views
Closure|string $callback

Return Value

array

in ManagesEvents at line 36
array composers(array $composers)

Register multiple view composers via an array.

Boot-only. The listeners persist on the singleton View Factory's event dispatcher for the worker lifetime and affect every subsequent request.

Parameters

array $composers

Return Value

array

in ManagesEvents at line 53
array composer(array|string $views, Closure|string $callback)

Register a view composer event.

Boot-only. The listener persists on the singleton View Factory's event dispatcher for the worker lifetime and affects every subsequent request.

Parameters

array|string $views
Closure|string $callback

Return Value

array

in ManagesEvents at line 67
protected Closure|null addViewEvent(string $view, Closure|string $callback, string $prefix = 'composing: ')

Add an event for a given view.

Parameters

string $view
Closure|string $callback
string $prefix

Return Value

Closure|null

in ManagesEvents at line 83
protected Closure addClassEvent(string $view, string $class, string $prefix)

Register a class based view composer.

Parameters

string $view
string $class
string $prefix

Return Value

Closure

in ManagesEvents at line 103
protected Closure buildClassEventCallback(string $class, string $prefix)

Build a class based container callback Closure.

Parameters

string $class
string $prefix

Return Value

Closure

in ManagesEvents at line 118
protected array parseClassEvent(string $class, string $prefix)

Parse a class based composer name.

Parameters

string $class
string $prefix

Return Value

array

in ManagesEvents at line 126
protected string classEventMethodForPrefix(string $prefix)

Determine the class event method based on the given prefix.

Parameters

string $prefix

Return Value

string

in ManagesEvents at line 134
protected void addEventListener(string $name, Closure $callback)

Add a listener to the event dispatcher.

Parameters

string $name
Closure $callback

Return Value

void

in ManagesEvents at line 148
void callComposer(View $view)

Call the composer for a given view.

Parameters

View $view

Return Value

void

in ManagesEvents at line 158
void callCreator(View $view)

Call the creator for a given view.

Parameters

View $view

Return Value

void

in ManagesFragments at line 25
void startFragment(string $fragment)

Start injecting content into a fragment.

Parameters

string $fragment

Return Value

void

in ManagesFragments at line 32
protected void pushFragmentStack(string $fragment)

No description

Parameters

string $fragment

Return Value

void

in ManagesFragments at line 46
string stopFragment()

Stop injecting content into a fragment.

Return Value

string

Exceptions

InvalidArgumentException

in ManagesFragments at line 67
mixed getFragment(string $name, string|null $default = null)

Get the contents of a fragment.

Parameters

string $name
string|null $default

Return Value

mixed

in ManagesFragments at line 75
array getFragments()

Get the entire array of rendered fragments.

Return Value

array

in ManagesFragments at line 83
void flushFragments()

Flush all of the fragments.

Return Value

void

in ManagesLayouts at line 32
void startSection(string $section, string|View|null $content = null)

Start injecting content into a section.

Parameters

string $section
string|View|null $content

Return Value

void

in ManagesLayouts at line 48
void inject(string $section, string $content)

Inject inline content into a section.

Parameters

string $section
string $content

Return Value

void

in ManagesLayouts at line 56
string yieldSection()

Stop injecting content into a section and return its contents.

Return Value

string

in ManagesLayouts at line 72
string stopSection(bool $overwrite = false)

Stop injecting content into a section.

Parameters

bool $overwrite

Return Value

string

Exceptions

InvalidArgumentException

in ManagesLayouts at line 99
string appendSection()

Stop injecting content into a section and append it.

Return Value

string

Exceptions

InvalidArgumentException

in ManagesLayouts at line 124
protected void extendSection(string $section, string $content)

Append content to a given section.

Parameters

string $section
string $content

Return Value

void

in ManagesLayouts at line 139
string yieldContent(string $section, string|View $default = '')

Get the string contents of a section.

Parameters

string $section
string|View $default

Return Value

string

in ManagesLayouts at line 160
string getParentPlaceholder(string $section = '')

Get the parent placeholder for the current request.

Parameters

string $section

Return Value

string

in ManagesLayouts at line 176
bool hasSection(string $name)

Check if section exists.

Parameters

string $name

Return Value

bool

in ManagesLayouts at line 185
bool sectionMissing(string $name)

Check if section does not exist.

Parameters

string $name

Return Value

bool

in ManagesLayouts at line 193
mixed getSection(string $name, string|null $default = null)

Get the contents of a section.

Parameters

string $name
string|null $default

Return Value

mixed

in ManagesLayouts at line 202
array getSections()

Get the entire array of sections.

Return Value

array

in ManagesLayouts at line 210
void flushSections()

Flush all of the sections.

Return Value

void

in ManagesLoops at line 21
void addLoop(mixed $data)

Add new loop to the stack.

Parameters

mixed $data

Return Value

void

in ManagesLoops at line 49
void incrementLoopIndices()

Increment the top loop's indices.

Return Value

void

in ManagesLoops at line 70
void popLoop()

Pop a loop from the top of the loop stack.

Return Value

void

in ManagesLoops at line 80
stdClass|null getLastLoop()

Get an instance of the last loop in the stack.

Return Value

stdClass|null

in ManagesLoops at line 92
array getLoopStack()

Get the entire loop stack.

Return Value

array

in ManagesStacks at line 30
void startPush(string $section, string $content = '')

Start injecting content into a push section.

Parameters

string $section
string $content

Return Value

void

in ManagesStacks at line 41
protected void pushStack(string $section)

No description

Parameters

string $section

Return Value

void

in ManagesStacks at line 62
string stopPush()

Stop injecting content into a push section.

Return Value

string

Exceptions

InvalidArgumentException

in ManagesStacks at line 78
protected void extendPush(string $section, string $content)

Append content to a given push section.

Parameters

string $section
string $content

Return Value

void

in ManagesStacks at line 100
void startPrepend(string $section, string $content = '')

Start prepending content into a push section.

Parameters

string $section
string $content

Return Value

void

in ManagesStacks at line 116
string stopPrepend()

Stop prepending content into a push section.

Return Value

string

Exceptions

InvalidArgumentException

in ManagesStacks at line 132
protected void extendPrepend(string $section, string $content)

Prepend content to a given stack.

Parameters

string $section
string $content

Return Value

void

in ManagesStacks at line 154
string yieldPushContent(string $section, string $default = '')

Get the string contents of a push section.

Parameters

string $section
string $default

Return Value

string

in ManagesStacks at line 179
bool isStackEmpty(string $section)

Determine if the given stack is empty.

Parameters

string $section

Return Value

bool

in ManagesStacks at line 190
void flushStacks()

Flush all of the stacks.

Return Value

void

void startTranslation(array $replacements = [])

Start a translation block.

Parameters

array $replacements

Return Value

void

string renderTranslation()

Render the current translation.

Return Value

string

at line 89
__construct(EngineResolver $engines, ViewFinderInterface $finder, Dispatcher $events)

Create a new view factory instance.

Parameters

EngineResolver $engines
ViewFinderInterface $finder
Dispatcher $events

at line 100
void __clone()

Clone the factory for isolated render-time namespace changes.

Return Value

void

at line 111
View file(string $path, Arrayable|array $data = [], array $mergeData = [])

Get the evaluated view contents for the given view.

Parameters

string $path
Arrayable|array $data
array $mergeData

Return Value

View

at line 123
View make(string $view, Arrayable|array $data = [], array $mergeData = [])

Get the evaluated view contents for the given view.

Parameters

string $view
Arrayable|array $data
array $mergeData

Return Value

View

at line 144
View first(array $views, Arrayable|array $data = [], array $mergeData = [])

Get the first view that actually exists from the given list.

Parameters

array $views
Arrayable|array $data
array $mergeData

Return Value

View

Exceptions

InvalidArgumentException

at line 160
string renderWhen(bool $condition, string $view, Arrayable|array $data = [], array $mergeData = [])

Get the rendered content of the view based on a given condition.

Parameters

bool $condition
string $view
Arrayable|array $data
array $mergeData

Return Value

string

at line 172
string renderUnless(bool $condition, string $view, Arrayable|array $data = [], array $mergeData = [])

Get the rendered content of the view based on the negation of a given condition.

Parameters

bool $condition
string $view
Arrayable|array $data
array $mergeData

Return Value

string

at line 180
string renderEach(string $view, array $data, string $iterator, string $empty = 'raw|')

Get the rendered contents of a partial from a loop.

Parameters

string $view
array $data
string $iterator
string $empty

Return Value

string

at line 211
protected string normalizeName(string $name)

Normalize a view name.

Parameters

string $name

Return Value

string

at line 219
protected array parseData(mixed $data)

Parse the given data into a raw array.

Parameters

mixed $data

Return Value

array

at line 227
protected View viewInstance(string $view, string $path, Arrayable|array $data)

Create a new view instance from the given arguments.

Parameters

string $view
string $path
Arrayable|array $data

Return Value

View

at line 235
bool exists(string $view)

Determine if a given view exists.

Parameters

string $view

Return Value

bool

at line 251
Engine getEngineFromPath(string $path)

Get the appropriate view engine for the given path.

Parameters

string $path

Return Value

Engine

Exceptions

InvalidArgumentException

at line 269
protected string|null getExtension(string $path)

Get the extension used by the view file.

Parameters

string $path

Return Value

string|null

at line 284
mixed share(array|string $key, mixed $value = null)

Add a piece of shared data to the environment.

Boot-only. Shared data persists on the singleton factory for the worker lifetime and is visible to every request handled by that worker.

Parameters

array|string $key
mixed $value

Return Value

mixed

at line 298
void incrementRender()

Increment the rendering counter.

Return Value

void

at line 308
void decrementRender()

Decrement the rendering counter.

Return Value

void

at line 322
void observeRendering(callable $observer)

Register a pre-render observer.

Boot-only. The observer is called before each view's engine executes, receiving the View instance. Observers persist for the worker lifetime on this singleton.

Parameters

callable $observer

Return Value

void

at line 330
void notifyRendering(View $view)

Notify pre-render observers that a view is about to render.

Parameters

View $view

Return Value

void

at line 340
protected int getRenderCount()

Get the rendering counter.

Return Value

int

at line 348
bool doneRendering()

Check if there are no active render operations.

Return Value

bool

at line 356
bool hasRenderedOnce(string $id)

Determine if the given once token has been rendered.

Parameters

string $id

Return Value

bool

at line 366
void markAsRenderedOnce(string $id)

Mark the given once token as having been rendered.

Parameters

string $id

Return Value

void

at line 382
void addLocation(string $location)

Add a location to the array of view locations.

Boot-only. The location persists on the singleton view finder for the worker lifetime and affects every subsequent request.

Parameters

string $location

Return Value

void

at line 393
void prependLocation(string $location)

Prepend a location to the array of view locations.

Boot-only. The location persists on the singleton view finder for the worker lifetime and affects every subsequent request.

Parameters

string $location

Return Value

void

at line 404
Factory addNamespace(string $namespace, string|array $hints)

Add a new namespace to the loader.

Boot-only. The namespace persists on the singleton view finder for the worker lifetime and affects every subsequent request.

Parameters

string $namespace
string|array $hints

Return Value

Factory

at line 417
Factory prependNamespace(string $namespace, string|array $hints)

Prepend a new namespace to the loader.

Boot-only. The namespace persists on the singleton view finder for the worker lifetime and affects every subsequent request.

Parameters

string $namespace
string|array $hints

Return Value

Factory

at line 430
Factory replaceNamespace(string $namespace, string|array $hints)

Replace the namespace hints for the given namespace.

Boot-only. The namespace persists on the singleton view finder for the worker lifetime and affects every subsequent request.

Parameters

string $namespace
string|array $hints

Return Value

Factory

at line 443
void addExtension(string $extension, string $engine, Closure|null $resolver = null)

Register a valid view extension and its engine.

Boot-only. The extension persists on the singleton Factory and engine resolver for the worker lifetime and affects every subsequent request.

Parameters

string $extension
string $engine
Closure|null $resolver

Return Value

void

at line 461
void flushState()

Flush all of the factory state like sections and stacks.

Return Value

void

at line 475
void flushStateIfDoneRendering()

Flush all of the section contents if done rendering.

Return Value

void

at line 485
array getExtensions()

Get the extension to engine bindings.

Return Value

array

at line 493
EngineResolver getEngineResolver()

Get the engine resolver instance.

Return Value

EngineResolver

at line 501
ViewFinderInterface getFinder()

Get the view finder instance.

Return Value

ViewFinderInterface

at line 513
void setFinder(ViewFinderInterface $finder)

Set the view finder instance.

Boot or tests only. Swaps the finder on the singleton View Factory used by every coroutine; per-request use races and changes resolution for all concurrent renders.

Parameters

ViewFinderInterface $finder

Return Value

void

at line 524
void flushFinderCache()

Flush the cache of views located by the finder.

Boot or tests only. Clears the singleton finder's path cache shared across all coroutines.

Return Value

void

at line 532
Dispatcher getDispatcher()

Get the event dispatcher instance.

Return Value

Dispatcher

at line 544
void setDispatcher(Dispatcher $events)

Set the event dispatcher instance.

Tests only. Swaps the dispatcher on the singleton View Factory used by every coroutine; per-request use races and breaks every concurrent view event.

Parameters

Dispatcher $events

Return Value

void

at line 552
Container getContainer()

Get the IoC container instance.

Return Value

Container

at line 564
void setContainer(Container $container)

Set the IoC container instance.

Tests only. Swaps the container on the singleton View Factory used by every coroutine; per-request use races and breaks every concurrent view resolution.

Parameters

Container $container

Return Value

void

at line 572
mixed shared(string $key, mixed $default = null)

Get an item from the shared data.

Parameters

string $key
mixed $default

Return Value

mixed

at line 580
array getShared()

Get all of the shared data for the environment.

Return Value

array

at line 588
array mergeSharedData(array $data)

Merge shared data into the given view data.

Parameters

array $data

Return Value

array