trait ManagesComponents

Constants

protected COMPONENT_STACK_CONTEXT_KEY

Context key for the components being rendered.

protected COMPONENT_DATA_CONTEXT_KEY

Context key for the original data passed to the component.

protected CURRENT_COMPONENT_DATA_CONTEXT_KEY

Context key for the component data for the component that is currently being rendered.

protected SLOTS_CONTEXT_KEY

Context key for the slot contents for the component.

protected SLOT_STACK_CONTEXT_KEY

Context key for the names of the slots being rendered.

Methods

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.

Details

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

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

No description

Parameters

View|Htmlable|Closure|string $view

Return Value

int

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

No description

Return Value

View|Htmlable|Closure|string|null

at line 73
protected void appendComponentData(array $data)

No description

Parameters

array $data

Return Value

void

at line 80
protected createSlotContext()

No description

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

at line 102
string renderComponent()

Render the current component.

Return Value

string

at line 130
protected array componentData()

Get the data for the given component.

Return Value

array

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

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

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

No description

Parameters

string $name
string|ComponentSlot|null $content

Return Value

void

at line 206
protected void pushSlotStack(array $value)

No description

Parameters

array $value

Return Value

void

at line 215
protected array popSlotStack()

No description

Return Value

array

at line 229
void endSlot()

Save the slot content for rendering.

Return Value

void

at line 244
protected int currentComponent()

Get the index for the current component.

Return Value

int

at line 253
protected void flushComponents()

Flush all of the component state.

Return Value

void