# Escape

The `Escape` class provides methods for escaping common HTML attributes data. This can be used to put untrusted data into typical attribute values like width, name, value, etc.

****

- Full class name: `Kirby\Toolkit\Escape`
- Alias: `Escape`
- Source: <https://github.com/getkirby/kirby/tree/5.5.3/src/Toolkit/Escape.php#L24>

****

### Escape

- [Escape::attr()](https://getkirby.com/docs/reference/objects/toolkit/escape/attr.md)
- [Escape::css()](https://getkirby.com/docs/reference/objects/toolkit/escape/css.md)
- [Escape::html()](https://getkirby.com/docs/reference/objects/toolkit/escape/html.md)
- [Escape::js()](https://getkirby.com/docs/reference/objects/toolkit/escape/js.md)
- [Escape::url()](https://getkirby.com/docs/reference/objects/toolkit/escape/url.md)
- [Escape::xml()](https://getkirby.com/docs/reference/objects/toolkit/escape/xml.md)

The Escape class is a wrapper for <a href="https://github.com/laminas/laminas-escaper">Laminas Escaper</a>.

<warning>
The methods of this class should not be used for complex attributes like href, src, style, or any of the event handlers like onmouseover. Use `esc($string, 'js')` for event handler attributes, `esc($string, 'url')` for src attributes and `esc($string, 'css')` for style attributes.
</warning>