trait ManagesStacks

Constants

protected PUSHES_CONTEXT_KEY

Context key for finished, captured push sections.

protected PREPENDS_CONTEXT_KEY

Context key for finished, captured prepend sections.

protected PUSH_STACK_CONTEXT_KEY

Context key for the stack of in-progress push sections.

Methods

void
startPush(string $section, string $content = '')

Start injecting content into a push section.

void
pushStack(string $section)

No description

string
stopPush()

Stop injecting content into a push section.

void
extendPush(string $section, string $content)

Append content to a given push section.

void
startPrepend(string $section, string $content = '')

Start prepending content into a push section.

string
stopPrepend()

Stop prepending content into a push section.

void
extendPrepend(string $section, string $content)

Prepend content to a given stack.

string
yieldPushContent(string $section, string $default = '')

Get the string contents of a push section.

bool
isStackEmpty(string $section)

Determine if the given stack is empty.

void
flushStacks()

Flush all of the stacks.

Details

at line 30
void startPush(string $section, string $content = '')

Start injecting content into a push section.

Parameters

string $section
string $content

Return Value

void

at line 41
protected void pushStack(string $section)

No description

Parameters

string $section

Return Value

void

at line 62
string stopPush()

Stop injecting content into a push section.

Return Value

string

Exceptions

InvalidArgumentException

at line 78
protected void extendPush(string $section, string $content)

Append content to a given push section.

Parameters

string $section
string $content

Return Value

void

at line 100
void startPrepend(string $section, string $content = '')

Start prepending content into a push section.

Parameters

string $section
string $content

Return Value

void

at line 116
string stopPrepend()

Stop prepending content into a push section.

Return Value

string

Exceptions

InvalidArgumentException

at line 132
protected void extendPrepend(string $section, string $content)

Prepend content to a given stack.

Parameters

string $section
string $content

Return Value

void

at line 154
string yieldPushContent(string $section, string $default = '')

Get the string contents of a push section.

Parameters

string $section
string $default

Return Value

string

at line 179
bool isStackEmpty(string $section)

Determine if the given stack is empty.

Parameters

string $section

Return Value

bool

at line 190
void flushStacks()

Flush all of the stacks.

Return Value

void