trait Illuminate / View / Concerns / ManagesComponents
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

ManagesComponents

Properties

protected

$componentStack array

The components being rendered.

Default: []
protected

$componentData array

The original data passed to the component.

Default: []
protected

$currentComponentData array

The component data for the component that is currently being rendered.

Default: []
protected

$slots array

The slot contents for the component.

Default: []
protected

$slotStack array

The names of the slots being rendered.

Default: []

Methods

public

startComponent ( $view , array $data ) : void

Start a component rendering process.

Parameters

public

startComponentFirst ( array $names , array $data ) : void

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

Parameters

  • $names array
  • $data array
public

renderComponent ( ) : string

Render the current component.

protected

componentData ( ) : array

Get the data for the given component.

public

getConsumableComponentData ( $key , $default ) : mixed|null

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

Parameters

  • $key string
  • $default mixed
public

slot ( $name , $content , $attributes ) : void

Start the slot rendering process.

Parameters

  • $name string
  • $content string|null
  • $attributes array
public

endSlot ( ) : void

Save the slot content for rendering.

protected

currentComponent ( ) : int

Get the index for the current component.

protected

flushComponents ( ) : void

Flush all of the component state.