protected function compileDisplayHeader(Twig_Compiler $compiler)
{
$compiler
- ->write("public function display(array \$context, array \$blocks = array())\n", "{\n")
+ ->write("protected function doDisplay(array \$context, array \$blocks = array())\n", "{\n")
->indent()
;
}
}
/**
+ * Displays the template with the given context.
+ *
+ * @param array $context An array of parameters to pass to the template
+ * @param array $blocks An array of blocks to pass to the template
+ */
+ public function display(array $context, array $blocks = array())
+ {
+ $this->doDisplay($context, $blocks);
+ }
+
+ /**
* Renders the template with the given context and returns it as string.
*
* @param array $context An array of parameters to pass to the template
}
/**
+ * Auto-generated method to display the template with the given context.
+ *
+ * @param array $context An array of parameters to pass to the template
+ * @param array $blocks An array of blocks to pass to the template
+ */
+ abstract protected function doDisplay(array $context, array $blocks = array());
+
+ /**
* Returns a variable from the context.
*
* @param array $context The context
* Displays the template with the given context.
*
* @param array $context An array of parameters to pass to the template
+ * @param array $blocks An array of blocks to pass to the template
*/
- function display(array $context);
+ function display(array $context, array $blocks = array());
/**
* Returns the bound environment for this template.
/* foo.twig */
class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template
{
- public function display(array \$context, array \$blocks = array())
+ protected function doDisplay(array \$context, array \$blocks = array())
{
\$context = array_merge(\$this->env->getGlobals(), \$context);
return \$this->parent;
}
- public function display(array \$context, array \$blocks = array())
+ protected function doDisplay(array \$context, array \$blocks = array())
{
\$context = array_merge(\$this->env->getGlobals(), \$context);
return \$this->parent;
}
- public function display(array \$context, array \$blocks = array())
+ protected function doDisplay(array \$context, array \$blocks = array())
{
\$context = array_merge(\$this->env->getGlobals(), \$context);
/* foo.twig */
class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template
{
- public function display(array \$context, array \$blocks = array())
+ protected function doDisplay(array \$context, array \$blocks = array())
{
\$this->checkSecurity();
\$context = array_merge(\$this->env->getGlobals(), \$context);
return \$this->parent;
}
- public function display(array \$context, array \$blocks = array())
+ protected function doDisplay(array \$context, array \$blocks = array())
{
\$context = array_merge(\$this->env->getGlobals(), \$context);
class Twig_TemplateTest extends Twig_Template
{
- public function display(array $context)
+ protected function doDisplay(array $context, array $blocks = array())
{
}