• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP template_compile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中template_compile函数的典型用法代码示例。如果您正苦于以下问题:PHP template_compile函数的具体用法?PHP template_compile怎么用?PHP template_compile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了template_compile函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: template

function template($filename, $flag = TEMPLATE_DISPLAY)
{
    global $_W;
    $source = IA_ROOT . "/web/themes/{$_W['template']}/{$filename}.html";
    $compile = IA_ROOT . "/data/tpl/web/{$_W['template']}/{$filename}.tpl.php";
    if (!is_file($source)) {
        $source = IA_ROOT . "/web/themes/default/{$filename}.html";
        $compile = IA_ROOT . "/data/tpl/web/default/{$filename}.tpl.php";
    }
    if (!is_file($source)) {
        exit("Error: template source '{$filename}' is not exist!");
    }
    if (DEVELOPMENT || !is_file($compile) || filemtime($source) > filemtime($compile)) {
        template_compile($source, $compile);
    }
    switch ($flag) {
        case TEMPLATE_DISPLAY:
        default:
            extract($GLOBALS, EXTR_SKIP);
            include $compile;
            break;
        case TEMPLATE_FETCH:
            extract($GLOBALS, EXTR_SKIP);
            ob_clean();
            ob_start();
            include $compile;
            $contents = ob_get_contents();
            ob_clean();
            return $contents;
            break;
        case TEMPLATE_INCLUDEPATH:
            return $compile;
            break;
    }
}
开发者ID:legeng,项目名称:project-2,代码行数:35,代码来源:template.func.php


示例2: template

 public function template($filename, $flag = TEMPLATE_INCLUDEPATH)
 {
     global $_W, $_GPC;
     $_W['template'] = $_W['account']['template'];
     $_W['template']['source'] = $_W['account']['template'];
     $source = IA_ROOT . "/addons/quicktemplate/{$this->mn}/{$_W['template']}/{$filename}.html";
     $compile = IA_ROOT . "/data/tpl/app/{$_W['template']}/{$this->mn}/{$filename}.tpl.php";
     if (!empty($_GPC['__template'])) {
         $source = IA_ROOT . "/addons/quicktemplate/{$this->mn}/{$_GPC['__template']}/{$filename}.html";
         if (!is_file($source)) {
             die('invalid debug template ' . $_GPC['__template']);
         }
     }
     if (!is_file($source)) {
         $source = IA_ROOT . "/addons/{$this->mn}/template/mobile/{$filename}.html";
         if (!is_file($source)) {
             $source = "{$_W['template']['source']}/mobile/default/{$this->mn}/{$filename}.html";
             if (!is_file($source)) {
                 $source = "{$_W['template']['source']}/mobile/{$_W['account']['template']}/{$filename}.html";
                 if (!is_file($source)) {
                     $source = "{$_W['template']['source']}/mobile/default/{$filename}.html";
                     if (!is_file($source)) {
                         exit("Error: template source '{$filename}' is not exist!");
                     }
                 }
             }
         }
     }
     WeUtility::logging('compile source', array($source, $compile));
     if (DEVELOPMENT || !is_file($compile) || filemtime($source) > filemtime($compile)) {
         template_compile($source, $compile, true);
     }
     return $compile;
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:34,代码来源:template.class.inc.php


示例3: template

function template($filename, $flag = TEMPLATE_DISPLAY)
{
    global $_W;
    $paths = explode('/', $filename);
    if (defined('IN_MOBILE')) {
        $source = "{$_W['template']['source']}/mobile/{$_W['account']['template']}/" . implode('/', $paths) . ".html";
        $compile = "{$_W['template']['compile']}/mobile/{$_W['account']['template']}/" . implode('/', $paths) . ".tpl.php";
        if (!is_file($source)) {
            $source = "{$_W['template']['source']}/mobile/default/" . implode('/', $paths) . ".html";
            $compile = "{$_W['template']['compile']}/mobile/default/" . implode('/', $paths) . ".tpl.php";
        }
    } else {
        $source = "{$_W['template']['source']}/web/{$_W['template']['current']}/{$filename}.html";
        $compile = "{$_W['template']['compile']}/web/{$_W['template']['current']}/{$filename}.tpl.php";
        if (!is_file($source)) {
            $source = "{$_W['template']['source']}/web/default/{$filename}.html";
            $compile = "{$_W['template']['compile']}/web/default/{$filename}.tpl.php";
        }
    }
    if (!is_file($source)) {
        exit("Error: template source '{$filename}' is not exist!");
    }
    if (DEVELOPMENT || !is_file($compile) || filemtime($source) > filemtime($compile)) {
        template_compile($source, $compile);
    }
    switch ($flag) {
        case TEMPLATE_DISPLAY:
        default:
            extract($GLOBALS, EXTR_SKIP);
            include $compile;
            break;
        case TEMPLATE_FETCH:
            extract($GLOBALS, EXTR_SKIP);
            ob_start();
            ob_clean();
            include $compile;
            $contents = ob_get_contents();
            ob_clean();
            return $contents;
            break;
        case TEMPLATE_INCLUDEPATH:
            return $compile;
            break;
        case TEMPLATE_CACHE:
            exit('暂未支持');
            break;
    }
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:48,代码来源:template.func.php


示例4: template

function template($filename, $flag = TEMPLATE_DISPLAY)
{
    global $_W, $_GPC;
    $source = IA_ROOT . "/app/themes/{$_W['template']}/{$filename}.html";
    $compile = IA_ROOT . "/data/tpl/app/{$_W['template']}/{$filename}.tpl.php";
    if (!is_file($source)) {
        $compatFilename = template_compat($filename);
        if (!empty($compatFilename)) {
            return template($compatFilename, $flag);
        }
    }
    if (!is_file($source)) {
        $source = IA_ROOT . "/app/themes/default/{$filename}.html";
        $compile = IA_ROOT . "/data/tpl/app/default/{$filename}.tpl.php";
    }
    if (!is_file($source)) {
        exit("Error: template source '{$filename}' is not exist!");
    }
    $paths = pathinfo($compile);
    $compile = str_replace($paths['filename'], $_W['uniacid'] . '_' . intval($_GPC['t']) . '_' . $paths['filename'], $compile);
    if (DEVELOPMENT || !is_file($compile) || filemtime($source) > filemtime($compile)) {
        template_compile($source, $compile);
    }
    switch ($flag) {
        case TEMPLATE_DISPLAY:
        default:
            extract($GLOBALS, EXTR_SKIP);
            include $compile;
            break;
        case TEMPLATE_FETCH:
            extract($GLOBALS, EXTR_SKIP);
            ob_clean();
            ob_start();
            include $compile;
            $contents = ob_get_contents();
            ob_clean();
            return $contents;
            break;
        case TEMPLATE_INCLUDEPATH:
            return $compile;
            break;
    }
}
开发者ID:ChainBoy,项目名称:wxfx,代码行数:43,代码来源:template.func.php


示例5: template

 protected function template($filename)
 {
     global $_W;
     $name = strtolower($this->module->id);
     $basePath = \Yii::getAlias($this->module->model->path);
     $baseCompiledPath = \Yii::getAlias($this->module->templateCompiledPath . '/' . $this->module->id);
     if (IN_SYS) {
         $source = $basePath . "/template/{$filename}.html";
         $compile = $baseCompiledPath . "/{$filename}.tpl.php";
     } else {
         $source = $basePath . "/template/mobile/{$filename}.html";
         $compile = $baseCompiledPath . "/mobile/{$filename}.tpl.php";
     }
     $paths = pathinfo($compile);
     $compile = str_replace($paths['filename'], $_W['uniacid'] . '_' . $paths['filename'], $compile);
     if (!is_file($source)) {
         exit("Error: template source '{$filename}' is not exist!");
     }
     if (!is_file($compile) || filemtime($source) > filemtime($compile)) {
         template_compile($source, $compile, true);
     }
     return $compile;
 }
开发者ID:weikit,项目名称:wechat-addon,代码行数:23,代码来源:base.php


示例6: template

function template($template = 'index', $dir = '')
{
    global $CFG;
    $to = $dir ? DT_CACHE . '/tpl/' . $dir . '-' . $template . '.php' : DT_CACHE . '/tpl/' . $template . '.php';
    $isfileto = is_file($to);
    if ($CFG['template_refresh'] || !$isfileto) {
        if ($dir) {
            $dir = $dir . '/';
        }
        $from = DT_ROOT . '/template/' . $CFG['template'] . '/' . $dir . $template . '.htm';
        if ($CFG['template'] != 'default' && !is_file($from)) {
            $from = DT_ROOT . '/template/default/' . $dir . $template . '.htm';
        }
        if (!$isfileto || filemtime($from) > filemtime($to) || filesize($to) == 0 && filesize($from) > 0) {
            require_once DT_ROOT . '/include/template.func.php';
            template_compile($from, $to);
        }
    }
    return $to;
}
开发者ID:oneoneplus,项目名称:webshell,代码行数:20,代码来源:global.func.php


示例7: template

 protected function template($filename)
 {
     global $_W;
     $name = strtolower($this->modulename);
     $defineDir = dirname($this->__define);
     if (defined('IN_SYS')) {
         $source = IA_ROOT . "/web/themes/{$_W['template']}/{$name}/{$filename}.html";
         $compile = IA_ROOT . "/data/tpl/web/{$_W['template']}/{$name}/{$filename}.tpl.php";
         if (!empty($defineDir)) {
             $source = $defineDir . "/template/{$filename}.html";
             $compile = IA_ROOT . "/data/tpl/web/addons/{$name}/{$filename}.tpl.php";
         }
         if (!is_file($source)) {
             $source = IA_ROOT . "/web/themes/default/{$name}/{$filename}.html";
         }
         if (!is_file($source)) {
             $source = $defineDir . "/template/{$filename}.html";
         }
         if (!is_file($source)) {
             $source = IA_ROOT . "/web/themes/{$_W['template']}/{$filename}.html";
         }
         if (!is_file($source)) {
             $source = IA_ROOT . "/web/themes/default/{$filename}.html";
         }
     } else {
         $source = IA_ROOT . "/app/themes/{$_W['template']}/{$name}/{$filename}.html";
         $compile = IA_ROOT . "/data/tpl/app/{$_W['template']}/{$name}/{$filename}.tpl.php";
         if (!is_file($source)) {
             $source = IA_ROOT . "/app/themes/default/{$name}/{$filename}.html";
         }
         if (!is_file($source)) {
             $source = $defineDir . "/template/mobile/{$filename}.html";
         }
         if (!is_file($source)) {
             $source = IA_ROOT . "/app/themes/{$_W['template']}/{$filename}.html";
         }
         if (!is_file($source)) {
             if (in_array($filename, array('header', 'footer', 'slide', 'toolbar', 'message'))) {
                 $source = IA_ROOT . "/app/themes/default/common/{$filename}.html";
             } else {
                 $source = IA_ROOT . "/app/themes/default/{$filename}.html";
             }
         }
     }
     if (!is_file($source)) {
         exit("Error: template source '{$filename}' is not exist!");
     }
     if (DEVELOPMENT || !is_file($compile) || filemtime($source) > filemtime($compile)) {
         template_compile($source, $compile, true);
     }
     return $compile;
 }
开发者ID:ruige123456,项目名称:dataMining,代码行数:52,代码来源:account.class.php


示例8: template

 protected function template($filename)
 {
     global $_W;
     $name = strtolower($this->modulename);
     $defineDir = dirname($this->__define);
     if (defined('IN_SYS')) {
         return parent::template($filename);
     } else {
         $source = THEME_DIR . "{$_W['account']['template']}/{$filename}.html";
         $compile = THEME_COMPILE_DIR . "{$name}/{$_W['account']['template']}/{$filename}.tpl.php";
         if (!is_file($source)) {
             $source = DEFAULT_THEME_DIR . "{$filename}.html";
         }
         if (!is_file($source)) {
             if (in_array($filename, array('header', 'footer', 'slide', 'toolbar', 'message'))) {
                 $source = IA_ROOT . "/app/themes/default/common/{$filename}.html";
             } else {
                 $source = IA_ROOT . "/app/themes/default/{$filename}.html";
             }
         }
     }
     if (!is_file($source)) {
         exit("Error: template source {$source}  - filename  '{$filename}' - name {$name} is not exist!");
     }
     if (DEVELOPMENT || !is_file($compile) || filemtime($source) > filemtime($compile)) {
         template_compile($source, $compile, true);
     }
     return $compile;
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:29,代码来源:template.php


示例9: template

 public function template($_var_14, $_var_15 = TEMPLATE_INCLUDEPATH)
 {
     global $_W;
     $_var_16 = strtolower($this->modulename);
     if (defined('IN_SYS')) {
         $_var_17 = IA_ROOT . "/web/themes/{$_W['template']}/{$_var_16}/{$_var_14}.html";
         $_var_18 = IA_ROOT . "/data/tpl/web/{$_W['template']}/{$_var_16}/{$_var_14}.tpl.php";
         if (!is_file($_var_17)) {
             $_var_17 = IA_ROOT . "/web/themes/default/{$_var_16}/{$_var_14}.html";
         }
         if (!is_file($_var_17)) {
             $_var_17 = IA_ROOT . "/addons/{$_var_16}/template/{$_var_14}.html";
         }
         if (!is_file($_var_17)) {
             $_var_17 = IA_ROOT . "/web/themes/{$_W['template']}/{$_var_14}.html";
         }
         if (!is_file($_var_17)) {
             $_var_17 = IA_ROOT . "/web/themes/default/{$_var_14}.html";
         }
         if (!is_file($_var_17)) {
             $_var_19 = explode('/', $_var_14);
             $_var_20 = array_slice($_var_19, 1);
             $_var_17 = IA_ROOT . "/addons/{$_var_16}/plugin/" . $_var_19[0] . '/template/' . implode('/', $_var_20) . '.html';
         }
     } else {
         $_var_21 = 'default';
         $_var_13 = IA_ROOT . '/addons/ewei_shop/data/template/shop_' . $_W['uniacid'];
         if (is_file($_var_13)) {
             $_var_21 = file_get_contents($_var_13);
             if (!is_dir(IA_ROOT . '/addons/ewei_shop/template/mobile/' . $_var_21)) {
                 $_var_21 = 'default';
             }
         }
         $_var_18 = IA_ROOT . "/data/tpl/app/ewei_shop/{$_var_21}/mobile/{$_var_14}.tpl.php";
         $_var_17 = IA_ROOT . "/addons/{$_var_16}/template/mobile/{$_var_21}/{$_var_14}.html";
         if (!is_file($_var_17)) {
             $_var_17 = IA_ROOT . "/addons/{$_var_16}/template/mobile/default/{$_var_14}.html";
         }
         if (!is_file($_var_17)) {
             $_var_17 = IA_ROOT . "/app/themes/{$_W['template']}/{$_var_14}.html";
         }
         if (!is_file($_var_17)) {
             $_var_17 = IA_ROOT . "/app/themes/default/{$_var_14}.html";
         }
     }
     if (!is_file($_var_17)) {
         die("Error: template source '{$_var_14}' is not exist!");
     }
     if (DEVELOPMENT || !is_file($_var_18) || filemtime($_var_17) > filemtime($_var_18)) {
         template_compile($_var_17, $_var_18, true);
     }
     return $_var_18;
 }
开发者ID:noikiy,项目名称:mygit,代码行数:53,代码来源:core1.php


示例10: template

 protected function template($filename, $flag = TEMPLATE_INCLUDEPATH)
 {
     global $_W;
     $mn = strtolower($this->module['name']);
     if ($this->inMobile) {
         $source = "{$_W['template']['source']}/mobile/{$_W['account']['template']}/{$mn}/{$filename}.html";
         $compile = "{$_W['template']['compile']}/mobile/{$_W['account']['template']}/{$mn}/{$filename}.tpl.php";
         if (!is_file($source)) {
             $source = "{$_W['template']['source']}/mobile/default/{$mn}/{$filename}.html";
             $compile = "{$_W['template']['compile']}/mobile/default/{$mn}/{$filename}.tpl.php";
         }
         if (!is_file($source)) {
             $source = IA_ROOT . "/source/modules/{$mn}/template/mobile/{$filename}.html";
             $compile = "{$_W['template']['compile']}/mobile/modules/{$mn}/{$filename}.tpl.php";
         }
         if (!is_file($source)) {
             $source = "{$_W['template']['source']}/mobile/{$_W['account']['template']}/{$filename}.html";
             $compile = "{$_W['template']['compile']}/mobile/{$_W['account']['template']}/{$filename}.tpl.php";
         }
         if (!is_file($source)) {
             $source = "{$_W['template']['source']}/mobile/default/{$filename}.html";
             $compile = "{$_W['template']['compile']}/mobile/default/{$filename}.tpl.php";
         }
     } else {
         $source = "{$_W['template']['source']}/web/{$_W['account']['template']}/modules/{$mn}/{$filename}.html";
         $compile = "{$_W['template']['compile']}/web/{$_W['account']['template']}/modules/{$mn}/{$filename}.tpl.php";
         if (!is_file($source)) {
             $source = "{$_W['template']['source']}/web/default/modules/{$mn}/{$filename}.html";
             $compile = "{$_W['template']['compile']}/web/default/modules/{$mn}/{$filename}.tpl.php";
         }
         if (!is_file($source)) {
             $source = IA_ROOT . "/source/modules/{$mn}/template/{$filename}.html";
             $compile = "{$_W['template']['compile']}/web/{$_W['account']['template']}/modules/{$mn}/{$filename}.tpl.php";
         }
         if (!is_file($source)) {
             $source = "{$_W['template']['source']}/web/{$_W['account']['template']}/{$filename}.html";
             $compile = "{$_W['template']['compile']}/web/{$_W['account']['template']}/{$filename}.tpl.php";
         }
         if (!is_file($source)) {
             $source = "{$_W['template']['source']}/web/default/{$filename}.html";
             $compile = "{$_W['template']['compile']}/web/default/{$filename}.tpl.php";
         }
     }
     if (!is_file($source)) {
         exit("Error: template source '{$filename}' is not exist!");
     }
     if (DEVELOPMENT || !is_file($compile) || filemtime($source) > filemtime($compile)) {
         template_compile($source, $compile, true);
     }
     return $compile;
 }
开发者ID:yunsite,项目名称:my-we7,代码行数:51,代码来源:engine.php


示例11: template

 protected function template($filename, $flag = TEMPLATE_INCLUDEPATH)
 {
     global $_W, $_GPC;
     $mn = strtolower($this->module['name']);
     $template = empty($this->module['config']['template']) ? "default" : $this->module['config']['template'];
     if (!empty($_GPC['template'])) {
         $template = trim($_GPC['template']);
     }
     if ($this->inMobile) {
         $source = IA_ROOT . "/source/modules/{$mn}/template/mobile/{$template}/{$filename}.html";
         $compile = "{$_W['template']['compile']}/mobile/modules/{$mn}/{$template}/{$filename}.tpl.php";
         if (!is_file($source)) {
             exit("Error222: template source '{$filename}' is not exist!");
         }
         if (DEVELOPMENT || !is_file($compile) || filemtime($source) > filemtime($compile)) {
             template_compile($source, $compile, true);
         }
         return $compile;
     } else {
         return parent::template($filename);
     }
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:22,代码来源:site.php


示例12: template

	public function template($filename, $flag = TEMPLATE_INCLUDEPATH) {
		global $_W;
		list($path, $filename) = explode('/', $filename);
		$source = IA_ROOT . "/source/modules/$path/template/{$filename}.html";  
		if(!is_file($source)) {
			$source = "{$_W['template']['source']}/{$_W['template']['current']}/{$filename}.html";
		}
		if(!is_file($source)) {
			exit("Error: template source '{$filename}' is not exist!");
		}
		$compile = "{$_W['template']['compile']}/{$_W['template']['current']}/{$path}/{$filename}.tpl.php";
		if (DEVELOPMENT || !is_file($compile) || filemtime($source) > filemtime($compile)) {
			template_compile($source, $compile);
		}
		switch ($flag) {
			case TEMPLATE_DISPLAY:
			default:
				extract($GLOBALS, EXTR_SKIP);
				include $compile;
				break;
			case TEMPLATE_FETCH:
				extract($GLOBALS, EXTR_SKIP);
				ob_start();
				ob_clean();
				include $compile;
				$contents = ob_get_contents();
				ob_clean();
				return $contents;
				break;
			case TEMPLATE_INCLUDEPATH:
				return $compile;
				break;
			case TEMPLATE_CACHE:
				exit('暂未支持');
				break;
		}
	}
开发者ID:royalwang,项目名称:saivi,代码行数:37,代码来源:engine.php



注:本文中的template_compile函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP template_control_richedit函数代码示例发布时间:2022-05-23
下一篇:
PHP template_clean_up_tags函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap