trait ManagesFragments

Constants

protected FRAGMENTS_CONTEXT_KEY

All of the captured, rendered fragments.

protected FRAGMENT_STACK_CONTEXT_KEY

The stack of in-progress fragment renders.

Methods

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.

Details

at line 25
void startFragment(string $fragment)

Start injecting content into a fragment.

Parameters

string $fragment

Return Value

void

at line 32
protected void pushFragmentStack(string $fragment)

No description

Parameters

string $fragment

Return Value

void

at line 46
string stopFragment()

Stop injecting content into a fragment.

Return Value

string

Exceptions

InvalidArgumentException

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

at line 75
array getFragments()

Get the entire array of rendered fragments.

Return Value

array

at line 83
void flushFragments()

Flush all of the fragments.

Return Value

void