diff --git a/modules/cms/twig/Extension.php b/modules/cms/twig/Extension.php index 8d6451f83..f123a744e 100644 --- a/modules/cms/twig/Extension.php +++ b/modules/cms/twig/Extension.php @@ -98,11 +98,12 @@ class Extension extends Twig_Extension * Renders a partial. * @param string $name Specifies the partial name. * @param array $parameters A optional list of parameters to pass to the partial. + * @param bool $throwException Throw an exception if the partial is not found. * @return string Returns the partial contents. */ - public function partialFunction($name, $parameters = []) + public function partialFunction($name, $parameters = [], $throwException = false) { - return $this->controller->renderPartial($name, $parameters); + return $this->controller->renderPartial($name, $parameters, $throwException); } /** diff --git a/modules/cms/twig/PartialNode.php b/modules/cms/twig/PartialNode.php index baf9778bb..003bcf2fc 100644 --- a/modules/cms/twig/PartialNode.php +++ b/modules/cms/twig/PartialNode.php @@ -37,6 +37,7 @@ class PartialNode extends Twig_Node ->write("echo \$this->env->getExtension('Cms\Twig\Extension')->partialFunction(") ->subcompile($this->getNode('nodes')->getNode(0)) ->write(", \$context['__cms_partial_params']") + ->write(", true") ->write(");\n") ;