Skip to content

Kirby 6.0.0

Str::esc()

Escape string for context specific output

Str::esc(string $string, 'html'|'attr'|'js'|'css'|'url'|'xml' $context = 'html'): string

Parameters

Name Type Default Description
$stringrequired string no default value Untrusted data
$context 'html'or'attr'or'js'or'css'or'url'or'xml' 'html' Location of output

Return type

string

Parent class

Kirby\Toolkit\Str