trait CompilesEchos

Properties

protected array<string, callable> $echoHandlers

Custom rendering callbacks for stringable objects.

Methods

void
stringable(string|callable $class, callable|null $handler = null)

Add a handler to be executed before echoing a given class.

string
compileEchos(string $value)

Compile Blade echos into valid PHP.

array
getEchoMethods()

Get the echo methods in the proper order for compilation.

string
compileRawEchos(string $value)

Compile the "raw" echo statements.

string
compileRegularEchos(string $value)

Compile the "regular" echo statements.

string
compileEscapedEchos(string $value)

Compile the escaped echo statements.

string
addBladeCompilerVariable(string $result)

Add an instance of the blade echo handler to the start of the compiled string.

string
wrapInEchoHandler(string $value)

Wrap the echoable value in an echo handler if applicable.

mixed
applyEchoHandler(mixed $value)

Apply the echo handler for the value if it exists.

Details

at line 22
void stringable(string|callable $class, callable|null $handler = null)

Add a handler to be executed before echoing a given class.

Parameters

string|callable $class
callable|null $handler

Return Value

void

at line 34
string compileEchos(string $value)

Compile Blade echos into valid PHP.

Parameters

string $value

Return Value

string

at line 48
protected array getEchoMethods()

Get the echo methods in the proper order for compilation.

Return Value

array

at line 60
protected string compileRawEchos(string $value)

Compile the "raw" echo statements.

Parameters

string $value

Return Value

string

at line 78
protected string compileRegularEchos(string $value)

Compile the "regular" echo statements.

Parameters

string $value

Return Value

string

at line 96
protected string compileEscapedEchos(string $value)

Compile the escaped echo statements.

Parameters

string $value

Return Value

string

at line 114
protected string addBladeCompilerVariable(string $result)

Add an instance of the blade echo handler to the start of the compiled string.

Parameters

string $result

Return Value

string

at line 122
protected string wrapInEchoHandler(string $value)

Wrap the echoable value in an echo handler if applicable.

Parameters

string $value

Return Value

string

at line 136
mixed applyEchoHandler(mixed $value)

Apply the echo handler for the value if it exists.

Parameters

mixed $value

Return Value

mixed