LaravelSection

Summary

No protected properties found
N/A
No private methods found
No private properties found
N/A
File
section.php
Package
Default
Class hierarchy
LaravelSection

Tags

None found

Properties

$sections

$sections : array

All of the captured sections.

Type

array

Tags

None found

$last

$last : array

The last section on which injection was started.

Type

array

Tags

None found

Methods

start()

start(string  $section, string|\Laravel\Closure  $content = '') : void

Start injecting content into a section.

// Start injecting into the "header" section Section::start('header');

// Inject a raw string into the "header" section without buffering
Section::start('header', '<title>Laravel</title>');

Parameters

string $section
string|LaravelClosure $content

static

Tags

None found

inject()

inject(string  $section, string  $content) : void

Inject inline content into a section.

This is helpful for injecting simple strings such as page titles.

// Inject inline content into the "header" section Section::inject('header', 'Laravel');

Parameters

string $section
string $content

static

Tags

None found

yield_section()

yield_section() : string

Stop injecting content into a section and return its contents.

Returns

string

static

Tags

None found

stop()

stop() : string

Stop injecting content into a section.

Returns

string

static

Tags

None found

append()

append(string  $section, string  $content) : void

Append content to a given section.

Parameters

string $section
string $content

static

Tags

None found

yielder()

yielder(string  $section) : string

Get the string contents of a section.

Parameters

string $section

Returns

string

static

Tags

None found

extend()

extend(string  $section, string  $content) : void

Extend the content in a given section.

Parameters

string $section
string $content

static

Tags

None found