mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 11:27:00 +00:00
fixed output when an error occurs in a template and render() is used (closes #23)
git-svn-id: http://svn.twig-project.org/trunk@126 93ef8e89-cb99-4229-a87c-7fa0fa45744b
This commit is contained in:
+10
-1
@@ -21,7 +21,16 @@ abstract class Twig_Template extends Twig_Resource implements Twig_TemplateInter
|
||||
public function render(array $context)
|
||||
{
|
||||
ob_start();
|
||||
$this->display($context);
|
||||
try
|
||||
{
|
||||
$this->display($context);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
ob_end_clean();
|
||||
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user