/** * Parses a template fragment as a nested block. * * @param string * @return string */ public function parse_as_nested($string, $php_data = false) { // unset the current parser, so we won't interfere and maybe replace it $tmp = $this->context->parser; unset($this->context->parser); $parser = new FTL_Parser(array('context' => $this->context, 'tag_prefix' => $tmp->tag_prefix, 'php_data' => $php_data)); $str = $parser->parse($string, $php_data); // reset $this->context->parser = $tmp; return $str; }
public static function parse($string) { $p = new FTL_Parser(self::$context, array('tag_prefix' => self::$tag_prefix)); return $p->parse($string); }
/** * Parses one tag as a standalone one. * * @param $tag_prefix * @param $string * * @return string */ public function parse_as_standalone($tag_prefix, $string) { $parser = new FTL_Parser(array('context' => $this->context, 'tag_prefix' => $tag_prefix)); return $parser->parse($string); }