ManagesComponents
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
Start a component rendering process.
Pop the current component from the stack.
Append data for the current component.
Create the slot context for the current component.
Get the first view that actually exists from the given list, and start a component.
Render the current component.
Get the data for the given component.
Get an item from the component data that exists above the current component.
Start the slot rendering process.
Set slot data for the current component.
Push a slot onto the stack.
Pop the current slot from the stack.
Save the slot content for rendering.
Get the index for the current component.
Flush all of the component state.
Details
at line 44
void
startComponent(View|Htmlable|Closure|string $view, array $data = [])
Start a component rendering process.
at line 58
protected int
pushComponentStack(View|Htmlable|Closure|string $view)
Push a component onto the stack.
at line 70
protected View|Htmlable|Closure|string|null
popComponentStack()
Pop the current component from the stack.
at line 82
protected void
appendComponentData(array $data)
Append data for the current component.
at line 92
protected void
createSlotContext()
Create the slot context for the current component.
at line 102
void
startComponentFirst(array $names, array $data = [])
Get the first view that actually exists from the given list, and start a component.
at line 114
string
renderComponent()
Render the current component.
at line 142
protected array
componentData()
Get the data for the given component.
at line 167
mixed
getConsumableComponentData(string $key, mixed $default = null)
Get an item from the component data that exists above the current component.
at line 198
void
slot(string $name, string|null $content = null, array $attributes = [])
Start the slot rendering process.
at line 212
protected void
setSlotData(string $name, string|ComponentSlot|null $content)
Set slot data for the current component.
at line 224
protected void
pushSlotStack(array $value)
Push a slot onto the stack.
at line 236
protected array
popSlotStack()
Pop the current slot from the stack.
at line 250
void
endSlot()
Save the slot content for rendering.
at line 265
protected int
currentComponent()
Get the index for the current component.
at line 274
protected void
flushComponents()
Flush all of the component state.