Symfony\Component\Templating\PhpEngine::getEscaper PHP Method

getEscaper() public method

Gets an escaper for a given context.
public getEscaper ( string $context ) : mixed
$context string The context name
return mixed $escaper A PHP callable
    public function getEscaper($context)
    {
        if (!isset($this->escapers[$context])) {
            throw new \InvalidArgumentException(sprintf('No registered escaper for context "%s".', $context));
        }

        return $this->escapers[$context];
    }