lithium\template\Helper::escape PHP Method

escape() public method

Escapes values according to the output type of the rendering context. Helpers that output to non-HTML/XML contexts should override this method accordingly.
public escape ( string $value, mixed $method = null, array $options = [] ) : mixed
$value string
$method mixed
$options array
return mixed
    public function escape($value, $method = null, array $options = array())
    {
        $defaults = array('escape' => true);
        $options += $defaults;
        if ($options['escape'] === false) {
            return $value;
        }
        if (is_array($value)) {
            return array_map(array($this, __FUNCTION__), $value);
        }
        return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
    }