Ejemplo n.º 1
0
Archivo: content.php Proyecto: nob/joi
 /**
  * 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;
 }
Ejemplo n.º 2
0
 /**
  * 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;
 }
Ejemplo n.º 3
0
Archivo: statamic.php Proyecto: nob/joi
 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();
 }