====== escape ======
{#JAPI Joomla.Framework Application JView::escape #}
Applies escaping to a value.
Escaping is used to prepare data so that its characters are not interpreted as special characters. As an example, having '<' signs in HTML documents can interfere with the markup of the page.
This is a flexible escape() method which allows any combination of methods to be used to escape values.
By default, the escape rules that have been defined in the object using the [[jview-addescape|addEscape]] and [[jview-setescape|setEscape]] methods are used. If additional parameters are provided, the escape methods specified in the method parameters are used instead.
Escape methods are specified by providing additional string parameters which contain the names of escape callback functions to be called (e.g. stripslashes, htmlspecialchars, etc.).
It is possible to perform escaping for values that are not strings by providing escape() methods that will operate on the supplied type.
This method returns the escaped value.
===== Syntax =====
mixed escape ( **$value** )
| **$value** | mixed | is a variable containing the value to be escaped. |
===== Examples =====
$result = $view->escape($value);
will escape $value using the callback functions that have been setup.
$result = $view->escape(
$value,
'stripslashes',
'htmlspecialchars',
array('StaticClass', 'method'),
array($object, $method)
);
will escape $value using the specified callback functions.
----
~~DISCUSSION~~
~~DISCUSSION~~