$field->escape()
Escapes the field value to be safely used in HTML templates without the risk of XSS attacks
$field->escape(string $context = 'html'): Field
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| $context | string |
'html'
|
Location of output (html, attr, js, css, url or xml) |
Return type
This method does not modify the existing $field object but returns a new object with the changes applied. Learn more →