Goetas\Twital\EventSubscriber\FixHtmlEntitiesInExpressionSubscriber::addPlaceholder PHP Method

addPlaceholder() public method

public addPlaceholder ( SourceEvent $event )
$event Goetas\Twital\EventDispatcher\SourceEvent
    public function addPlaceholder(SourceEvent $event)
    {
        $source = $event->getTemplate();
        $format = $this->placeholderFormat;
        $source = $this->processTwig($source, function ($twig) use($format) {
            return sprintf($format, htmlspecialchars($twig, ENT_COMPAT, 'UTF-8'));
        });
        $event->setTemplate($source);
    }