ManagesLayouts
trait ManagesLayouts
Constants
| protected SECTIONS_CONTEXT_KEY |
Context key for finished, captured sections. |
| protected SECTION_STACK_CONTEXT_KEY |
Context key for the stack of in-progress sections. |
| protected PARENT_PLACEHOLDER_CONTEXT_KEY |
Context key for the parent placeholder. |
Methods
Start injecting content into a section.
Inject inline content into a section.
Stop injecting content into a section and return its contents.
Stop injecting content into a section.
Stop injecting content into a section and append it.
Append content to a given section.
Get the parent placeholder for the current request.
Check if section exists.
Check if section does not exist.
Get the contents of a section.
Get the entire array of sections.
Flush all of the sections.
Details
at line 32
void
startSection(string $section, string|View|null $content = null)
Start injecting content into a section.
at line 48
void
inject(string $section, string $content)
Inject inline content into a section.
at line 56
string
yieldSection()
Stop injecting content into a section and return its contents.
at line 72
string
stopSection(bool $overwrite = false)
Stop injecting content into a section.
at line 99
string
appendSection()
Stop injecting content into a section and append it.
at line 124
protected void
extendSection(string $section, string $content)
Append content to a given section.
at line 139
string
yieldContent(string $section, string|View $default = '')
Get the string contents of a section.
at line 160
string
getParentPlaceholder(string $section = '')
Get the parent placeholder for the current request.
at line 176
bool
hasSection(string $name)
Check if section exists.
at line 185
bool
sectionMissing(string $name)
Check if section does not exist.
at line 193
mixed
getSection(string $name, string|null $default = null)
Get the contents of a section.
at line 202
array
getSections()
Get the entire array of sections.
at line 210
void
flushSections()
Flush all of the sections.