예제 #1
0
 public function _include($attr, $content)
 {
     if (!empty($attr['file'])) {
         $file = "template/" . C("WEB_STYLE") . "/" . $attr['file'];
         if (is_file($file)) {
             $view = new ViewHd();
             $view->fetch($file);
             return $view->getCompileContent();
         }
     }
 }
예제 #2
0
 public function _include($attr, $content, &$hd)
 {
     //替换常量
     $const = get_defined_constants(true);
     foreach ($const['user'] as $k => $v) {
         $attr['file'] = str_replace($k, $v, $attr['file']);
     }
     //删除域名
     $file = str_replace(__ROOT__ . '/', '', trim($attr['file']));
     $view = new ViewHd();
     $view->fetch($file);
     return file_get_contents($view->compileFile);
 }
예제 #3
0
파일: ViewTag.class.php 프로젝트: jyht/v5
 /**
  * 加载模板文件
  * @param $attr
  * @param $content
  * @return string
  */
 public function _load($attr, $content)
 {
     if (!isset($attr['file'])) {
         halt('load 模板标签必须有value属性', false);
         //load标签必须有file属性
     }
     $const = print_const(false, true);
     foreach ($const as $k => $v) {
         $attr['file'] = str_replace($k, $v, $attr['file']);
     }
     $file = str_replace(__ROOT__ . '/', '', trim($attr['file']));
     $view = new ViewHd();
     $view->fetch($file);
     return $view->getCompileContent();
 }
예제 #4
0
 /**
  * 加载模板文件
  * @param $attr
  * @param $content
  * @return string
  */
 public function _include($attr, $content)
 {
     if (!isset($attr['file'])) {
         return;
     }
     $const = print_const(false, true);
     foreach ($const as $k => $v) {
         $attr['file'] = str_replace($k, $v, $attr['file']);
     }
     $file = str_replace(__ROOT__ . '/', '', trim($attr['file']));
     $view = new ViewHd();
     $view->fetch($file);
     return $view->getCompileContent();
 }