Skip to content

Kirby 6.0.0

$fieldMethods->escape()

Escapes the field value to be safely used in HTML templates without the risk of XSS attacks

$fieldMethods->escape(string $context = 'html'): FieldMethods

Parameters

Name Type Default Description
$context string 'html' Location of output (html, attr, js, css, url or xml)

Return type

Kirby\Content\FieldMethods

This method does not modify the existing $fieldmethods object but returns a new object with the changes applied. Learn more →

Parent class

Kirby\Content\FieldMethods