[Templating] added a way to change renderers after the Engine is created
This commit is contained in:
parent
26f1434b14
commit
81af3d6a58
@ -5,6 +5,7 @@ namespace Symfony\Components\Templating;
|
||||
use Symfony\Components\Templating\Loader\LoaderInterface;
|
||||
use Symfony\Components\Templating\Helper\HelperSet;
|
||||
use Symfony\Components\Templating\Renderer\PhpRenderer;
|
||||
use Symfony\Components\Templating\Renderer\RendererInterface;
|
||||
|
||||
/*
|
||||
* This file is part of the symfony package.
|
||||
@ -307,6 +308,18 @@ class Engine
|
||||
return $this->charset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a template renderer.
|
||||
*
|
||||
* @param string $name The renderer name
|
||||
* @param RendererInterface $renderer A RendererInterface instance
|
||||
*/
|
||||
public function setRenderer($name, RendererInterface $renderer)
|
||||
{
|
||||
$this->renderers[$name] = $renderer;
|
||||
$renderer->setEngine($this);
|
||||
}
|
||||
|
||||
protected function splitTemplateName($name)
|
||||
{
|
||||
if (false !== $pos = strpos($name, ':'))
|
||||
|
Reference in New Issue
Block a user