ManagesEvents
trait ManagesEvents (View source)
Methods
array
composers(array $composers)
Register multiple view composers via an array.
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
void
void
Details
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.
protected Closure|null
addViewEvent(string $view, Closure|string $callback, string $prefix = 'composing: ')
Add an event for a given view.
protected Closure
addClassEvent(string $view, string $class, string $prefix)
Register a class based view composer.
protected Closure
buildClassEventCallback(string $class, string $prefix)
Build a class based container callback Closure.
protected array
parseClassEvent(string $class, string $prefix)
Parse a class based composer name.
protected string
classEventMethodForPrefix(string $prefix)
Determine the class event method based on the given prefix.
protected 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.