diff --git a/src/Symfony/Component/Templating/DelegatingEngine.php b/src/Symfony/Component/Templating/DelegatingEngine.php index 9c558961de..8717ef0f3d 100644 --- a/src/Symfony/Component/Templating/DelegatingEngine.php +++ b/src/Symfony/Component/Templating/DelegatingEngine.php @@ -103,6 +103,15 @@ class DelegatingEngine implements EngineInterface return false; } + /** + * Get an engine able to render the given template. + * + * @param string $name A template name + * + * @return EngineInterface The engine + * + * @throws \RuntimeException if no engine able to work with the template is found + */ protected function getEngine($name) { foreach ($this->engines as $engine) { diff --git a/src/Symfony/Component/Templating/PhpEngine.php b/src/Symfony/Component/Templating/PhpEngine.php index c38898383d..4fbaf13bb0 100644 --- a/src/Symfony/Component/Templating/PhpEngine.php +++ b/src/Symfony/Component/Templating/PhpEngine.php @@ -221,6 +221,11 @@ class PhpEngine implements EngineInterface, \ArrayAccess } } + /** + * Sets the helpers. + * + * @params Helper[] $helpers An array of helper + */ public function setHelpers(array $helpers) { $this->helpers = array(); @@ -286,7 +291,8 @@ class PhpEngine implements EngineInterface, \ArrayAccess /** * Escapes a string by using the current charset. * - * @param mixed $value A variable to escape + * @param mixed $value A variable to escape + * @param string $context The context name * * @return string The escaped value */ @@ -440,6 +446,17 @@ class PhpEngine implements EngineInterface, \ArrayAccess ); } + /** + * Convert a string from one encoding to another. + * + * @param string $string The string to convert + * @param string $to The input encoding + * @param string $from The output encoding + * + * @return string The string with the new encoding + * + * @throws \RuntimeException if no suitable encoding function is found (iconv or mbstring) + */ public function convertEncoding($string, $to, $from) { if (function_exists('iconv')) {