Class yii\twig\Template

Inheritanceyii\twig\Template
Source Code https://github.com/yiisoft/yii2-twig/blob/master/src/Template.php

Template helper

Protected Methods

Hide inherited methods

Method Description Defined By
displayWithErrorHandling() yii\twig\Template

Method Details

Hide inherited methods

displayWithErrorHandling() protected method

protected void displayWithErrorHandling ( array $context, array $blocks = array() )
$context
$blocks

                protected function displayWithErrorHandling(array $context, array $blocks = array())
{
    try {
        parent::displayWithErrorHandling($context, $blocks);
    } catch (\Error $e) {
        $r = new \ReflectionObject($this);
        $file = $r->getFileName();
        foreach ($e->getTrace() as $trace) {
            if (isset($trace['file']) and $trace['file'] == $file) {
                $debugInfo = $this->getDebugInfo();
                if (isset($trace['line']) && isset($debugInfo[$trace['line']])) {
                    throw new \Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), $debugInfo[$trace['line']], $this->getSourceContext());
                }
            }
        }
        throw $e;
    }
}