コード例 #1
0
ファイル: TemplateManager.php プロジェクト: Esisto/IoEsisto
 static function parseTemplate($template)
 {
     $tp = new TemplateParser();
     $tp->parser = xml_parser_create();
     $tp->setFile($template);
     if (!file_exists($tp->filename)) {
         return self::$FILE_NOT_EXISTS;
     }
     if (xml_parse_into_struct($tp->parser, file_get_contents($tp->filename), $tp->template)) {
         //echo serialize($tp->template); //DEBUG
         return $tp;
     }
     return self::$PARSE_ERROR;
 }