public static function compile($template, array $variables, $filter = null)
{
return preg_replace_callback(self::variablePattern, self::_compileFunction($variables, $filter), $template);
}
/** * */ public function testCompile() { $template = Template::compile(':foo {:bar}', ['foo' => 'foo', 'bar' => 'bar']); $this->assertEquals('foo bar', $template); $template = Template::compile(':html', ['html' => '<html>'], 'htmlspecialchars'); $this->assertEquals('<html>', $template); }