EncodedHtmlString
class EncodedHtmlString extends HtmlString (View source)
Properties
protected string | $html | The HTML string. |
from HtmlString |
static protected callable|null | $encodeUsingFactory | The callback that should be used to encode the HTML strings. |
Methods
void
__construct(string $html = '', bool $doubleEncode = true)
Create a new encoded HTML string instance.
string
toHtml()
Get the HTML string.
static string
convert(string|null $value, bool $withQuote = true, bool $doubleEncode = true)
Convert the special characters in the given value.
static void
encodeUsing(callable|null $factory = null)
Set the callable that will be used to encode the HTML strings.
static void
flushState()
Flush the class's global state.
Details
void
__construct(string $html = '', bool $doubleEncode = true)
Create a new encoded HTML string instance.
string
toHtml()
Get the HTML string.
bool
isEmpty()
Determine if the given HTML string is empty.
bool
isNotEmpty()
Determine if the given HTML string is not empty.
string
__toString()
Get the HTML string.
static string
convert(string|null $value, bool $withQuote = true, bool $doubleEncode = true)
internal |
Convert the special characters in the given value.
static void
encodeUsing(callable|null $factory = null)
Set the callable that will be used to encode the HTML strings.
static void
flushState()
Flush the class's global state.