trait ManagesStacks

Properties

protected array $pushes

All of the finished, captured push sections.

protected array $prepends

All of the finished, captured prepend sections.

protected array $pushStack

The stack of in-progress push sections.

Methods

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

Start injecting content into a push section.

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.

void
flushStacks()

Flush all of the stacks.

Details

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

Start injecting content into a push section.

Parameters

string $section
string $content

Return Value

void

at line 54
string stopPush()

Stop injecting content into a push section.

Return Value

string

Exceptions

InvalidArgumentException

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

Append content to a given push section.

Parameters

string $section
string $content

Return Value

void

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

Start prepending content into a push section.

Parameters

string $section
string $content

Return Value

void

at line 109
string stopPrepend()

Stop prepending content into a push section.

Return Value

string

Exceptions

InvalidArgumentException

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

Prepend content to a given stack.

Parameters

string $section
string $content

Return Value

void

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

Get the string contents of a push section.

Parameters

string $section
string $default

Return Value

string

at line 171
void flushStacks()

Flush all of the stacks.

Return Value

void