/** * Parses given $template_data with $data, converts content to $type * * @param string $template_data Template data to parse * @param array $data List of variables to fill in * @param mixed $type Optional content type to render * @return string */ public static function parse($template_data, $data, $type = NULL) { $app = \Slim\Slim::getInstance(); $data = array_merge($data, $app->config); $parser = new Lex\Parser(); $parser->cumulativeNoparse(TRUE); $parse_order = Config::getParseOrder(); if ($parse_order[0] == 'tags') { $output = $parser->parse($template_data, $data); $output = self::transform($output, $type); } else { $output = self::transform($template_data, $type); $output = $parser->parse($output, $data); } return $output; }
/** * Parses given $template_data with $data, converts content to $type * * @param string $template_data Template data to parse * @param array $data List of variables to fill in * @param mixed $type Optional content type to render * @return string */ public static function parse($template_data, $data, $type = NULL) { $app = \Slim\Slim::getInstance(); $config = $app->config; foreach ($config as $key => $item) { if (is_object($item)) { unset($config[$key]); } } $data = $data + $config; $parse_order = Config::getParseOrder(); if ($parse_order[0] == 'tags') { $output = Parse::template($template_data, $data); $output = self::transform($output, $type); } else { $output = self::transform($template_data, $type); $output = Parse::template($output, $data); } return $output; }
public static function get_parse_order() { Log::warn("Use of Statamic::get_parse_order() is deprecated. Use Config::getParseOrder() instead.", "core", "Statamic"); return Config::getParseOrder(); }