On this page
ManagesLayouts
trait ManagesLayouts (View source)
Properties
protected array | $sections | All of the finished, captured sections. |
|
protected array | $sectionStack | The stack of in-progress sections. |
|
static protected mixed | $parentPlaceholder | The parent placeholder for the request. |
|
static protected string | $parentPlaceholderSalt | The parent placeholder salt for the request. |
Methods
void | startSection(string $section, string|null $content = null) Start injecting content into a section. |
|
void | inject(string $section, string $content) Inject inline content into a section. |
|
string | yieldSection() Stop injecting content into a section and return its contents. |
|
string | stopSection(bool $overwrite = false) Stop injecting content into a section. |
|
string | appendSection() Stop injecting content into a section and append it. |
|
void | extendSection(string $section, string $content) Append content to a given section. |
|
string | yieldContent(string $section, string $default = '') Get the string contents of a section. |
|
static string | parentPlaceholder(string $section = '') Get the parent placeholder for the current request. |
|
static string | parentPlaceholderSalt() Get the parent placeholder salt. |
|
bool | hasSection(string $name) Check if section exists. |
|
bool | sectionMissing(string $name) Check if section does not exist. |
|
mixed | getSection(string $name, string|null $default = null) Get the contents of a section. |
|
array | getSections() Get the entire array of sections. |
|
void | flushSections() Flush all of the sections. |
Details
void startSection(string $section, string|null $content = null)
Start injecting content into a section.
void inject(string $section, string $content)
Inject inline content into a section.
string yieldSection()
Stop injecting content into a section and return its contents.
string stopSection(bool $overwrite = false)
Stop injecting content into a section.
string appendSection()
Stop injecting content into a section and append it.
protected void extendSection(string $section, string $content)
Append content to a given section.
string yieldContent(string $section, string $default = '')
Get the string contents of a section.
static string parentPlaceholder(string $section = '')
Get the parent placeholder for the current request.
static protected string parentPlaceholderSalt()
Get the parent placeholder salt.
bool hasSection(string $name)
Check if section exists.
bool sectionMissing(string $name)
Check if section does not exist.
mixed getSection(string $name, string|null $default = null)
Get the contents of a section.
array getSections()
Get the entire array of sections.
void flushSections()
Flush all of the sections.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/10.x/Illuminate/View/Concerns/ManagesLayouts.html