Add back Twig::processString() as it is used in plugins

This commit is contained in:
Matias Griese
2014-10-07 20:47:44 +03:00
parent 9fb56df9a0
commit df475af2fd

View File

@@ -185,6 +185,24 @@ class Twig
return $output;
}
/**
* @param string $string string to render.
* @param array $vars Optional variables
* @return string
*/
public function processString($string, array $vars = array())
{
// override the twig header vars for local resolution
$this->grav->fireEvent('onTwigStringVariables');
$vars += $this->twig_vars;
$name = '@Var:' . $string;
$this->setTemplate($name, $string);
$output = $this->twig->render($name, $vars);
return $output;
}
/**
* Twig process that renders the site layout. This is the main twig process that renders the overall
* page and handles all the layout for the site display.