|
|
| __construct (private $charset='UTF-8',) |
| | setEscaper ($strategy, callable $callable) |
| | getEscapers () |
| | setSafeClasses (array $safeClasses=[]) |
| | addSafeClass (string $class, array $strategies) |
| | escape ($string, string $strategy='html', ?string $charset=null, bool $autoescape=false) |
|
|
| $safeClasses = [] |
|
| $safeLookup = [] |
◆ addSafeClass()
| addSafeClass |
( |
string | $class, |
|
|
array | $strategies ) |
- Paramètres
-
Stringable> $class
- Paramètres
-
- Renvoie
- void
◆ escape()
| escape |
( |
| $string, |
|
|
string | $strategy = 'html', |
|
|
?string | $charset = null, |
|
|
bool | $autoescape = false ) |
Escapes a string.
- Paramètres
-
| mixed | $string | The value to be escaped |
| string | $strategy | The escaping strategy |
| string | null | $charset | The charset |
| bool | $autoescape | Whether the function is called by the auto-escaping feature (true) or by the developer (false) |
- Exceptions
-
This function is adapted from code coming from Zend Framework.
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (https://www.zend.com) @license https://framework.zend.com/license/new-bsd New BSD License
◆ getEscapers()
Gets all defined escapers.
- Renvoie
- array<string, callable(string $string, string $charset): string> An array of escapers
◆ setEscaper()
| setEscaper |
( |
| $strategy, |
|
|
callable | $callable ) |
Defines a new escaper to be used via the escape filter.
- Paramètres
-
| string | $strategy | The strategy name that should be used as a strategy in the escape call |
| callable(string | $string, string $charset): string $callable A valid PHP callable |
- Renvoie
- void
◆ setSafeClasses()
| setSafeClasses |
( |
array | $safeClasses = [] | ) |
|
- Paramètres
-
Stringable>, string[]> $safeClasses
- Renvoie
- void
La documentation de cette classe a été générée à partir du fichier suivant :
- vendor/twig/twig/src/Runtime/EscaperRuntime.php