EncodedHtmlString
class EncodedHtmlString extends HtmlString
Constants
| protected ENCODER_CONTEXT_KEY |
Context key for temporarily scoped encoder callbacks. |
Properties
| protected mixed | $html | The HTML string. |
from HtmlString |
| static protected Closure|null | $encodeUsingFactory | The callback that should be used to encode the HTML strings. |
Methods
Create a new encoded HTML string instance.
Get the HTML string.
Convert the special characters in the given value.
Set the callable that will be used to encode the HTML strings.
Execute the given callback using a temporary encoder.
Flush all static state.
Details
at line 29
__construct(mixed $html = '', bool $doubleEncode = true)
Create a new encoded HTML string instance.
at line 49
string
toHtml()
Get the HTML string.
in
HtmlString at line 36
bool
isEmpty()
Determine if the given HTML string is empty.
in
HtmlString at line 44
bool
isNotEmpty()
Determine if the given HTML string is not empty.
in
HtmlString at line 52
string
__toString()
Get the HTML string.
at line 39
static string
convert(string|null $value, bool $withQuote = true, bool $doubleEncode = true)
| internal |
Convert the special characters in the given value.
at line 79
static void
encodeUsing(callable|null $factory = null)
Set the callable that will be used to encode the HTML strings.
Boot-only. The factory persists in a static property for the worker lifetime and applies to every encoded HTML string.
at line 87
static mixed
withEncoding(callable $factory, callable $callback)
Execute the given callback using a temporary encoder.
at line 110
static void
flushState()
Flush all static state.