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

PHP file_exists_case函数代码示例

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

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



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

示例1: parseTemplateFile

 /**
  * 自动定位模板文件
  * @access private
  * @param string $templateFile 文件名
  * @return string
  */
 private function parseTemplateFile($templateFile)
 {
     if ('' == $templateFile) {
         // 如果模板文件名为空 按照默认规则定位
         $templateFile = C('TEMPLATE_NAME');
     } elseif (false === strpos($templateFile, C('TMPL_TEMPLATE_SUFFIX'))) {
         // 解析规则为 分组@模板主题:模块:操作
         if (strpos($templateFile, '@')) {
             list($group, $templateFile) = explode('@', $templateFile);
             if (1 == C('APP_GROUP_MODE')) {
                 $basePath = dirname(BASE_LIB_PATH) . '/';
             } else {
                 $basePath = TMPL_PATH;
             }
             $basePath .= $group . '/' . basename(TMPL_PATH) . '/' . (THEME_NAME ? THEME_NAME . '/' : '');
         } else {
             $basePath = THEME_PATH;
         }
         $path = explode(':', $templateFile);
         $action = array_pop($path);
         $module = !empty($path) ? array_pop($path) : MODULE_NAME;
         if (!empty($path)) {
             // 设置模板主题
             $basePath = dirname($basePath) . '/' . array_pop($path) . '/';
         }
         $templateFile = $basePath . $module . C('TMPL_FILE_DEPR') . $action . C('TMPL_TEMPLATE_SUFFIX');
     }
     if (!file_exists_case($templateFile)) {
         throw_exception(L('_TEMPLATE_NOT_EXIST_') . '[' . $templateFile . ']');
     }
     return $templateFile;
 }
开发者ID:omusico,项目名称:MRFOS,代码行数:38,代码来源:LocationTemplateBehavior.class.php


示例2: parseTemplate

 /**
  * 自动定位模板文件
  * @access protected
  * @param string $template 模板文件规则
  * @return string
  */
 public function parseTemplate($template = '')
 {
     $plugin = $this->name;
     $plugin_config = $this->config;
     $theme = $plugin_config['theme'];
     $depr = "/";
     if (empty($theme)) {
         $theme = "";
     } else {
         $theme = $depr . $theme;
     }
     $template = str_replace(':', $depr, $template);
     // 分析模板文件规则
     if ('' == $template) {
         // 如果模板文件名为空 按照默认规则定位
         $template = "/" . PLUGIN_CONTROLLER_NAME . $depr . PLUGIN_ACTION_NAME;
     } elseif (false === strpos($template, '/')) {
         $template = "/" . PLUGIN_CONTROLLER_NAME . $depr . $template;
     }
     $v_layer = C("DEFAULT_V_LAYER");
     $file = sp_add_template_file_suffix("./plugins/{$plugin}/{$v_layer}" . $theme . $template);
     if (!file_exists_case($file)) {
         E(L('_TEMPLATE_NOT_EXIST_') . ':' . $file);
     }
     return $file;
 }
开发者ID:crab890715,项目名称:GoOut-Panel,代码行数:32,代码来源:PluginController.class.php


示例3: renderFile

 /**
 +----------------------------------------------------------
 * 渲染模板输出 供render方法内部调用
 +----------------------------------------------------------
 * @access public
 +----------------------------------------------------------
 * @param string $templateFile  模板文件
 * @param mixed $var  模板变量
 * @param string $charset  模板编码
 +----------------------------------------------------------
 * @return string
 +----------------------------------------------------------
 */
 protected function renderFile($templateFile = '', $var = '', $charset = 'utf-8')
 {
     ob_start();
     ob_implicit_flush(0);
     if (!file_exists_case($templateFile)) {
         // 自动定位模板文件
         $name = substr(get_class($this), 0, -6);
         $filename = empty($templateFile) ? $name : $templateFile;
         $templateFile = LIB_PATH . 'Widget/' . $name . '/' . $filename . C('TMPL_TEMPLATE_SUFFIX');
         if (!file_exists_case($templateFile)) {
             throw_exception(L('_TEMPLATE_NOT_EXIST_') . '[' . $templateFile . ']');
         }
     }
     $template = $this->template ? $this->template : strtolower(C('TMPL_ENGINE_TYPE') ? C('TMPL_ENGINE_TYPE') : 'php');
     if ('php' == $template) {
         // 使用PHP模板
         if (!empty($var)) {
             extract($var, EXTR_OVERWRITE);
         }
         // 直接载入PHP模板
         include $templateFile;
     } else {
         $className = 'Template' . ucwords($template);
         require_cache(THINK_PATH . '/Lib/Think/Util/Template/' . $className . '.class.php');
         $tpl = new $className();
         $tpl->fetch($templateFile, $var, $charset);
     }
     $content = ob_get_clean();
     return $content;
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:43,代码来源:Widget.class.php


示例4: _admintpl

 /**
  * 模板包含标签 
  * 格式
  * <admintpl file="APP/模块/模板"/>
  * @staticvar array $_admintemplateParseCache
  * @param type $attr 属性字符串
  * @param type $content 标签内容
  * @return array 
  */
 public function _admintpl($attr, $content)
 {
     static $_admintemplateParseCache = array();
     $cacheIterateId = md5($attr . $content);
     if (isset($_admintemplateParseCache[$cacheIterateId])) {
         return $_admintemplateParseCache[$cacheIterateId];
     }
     //分析Admintemplate标签的标签定义
     $tag = $this->parseXmlAttr($attr, 'admintpl');
     $file = explode("/", $tag['file']);
     $counts = count($file);
     if ($counts < 3) {
         $file_path = DIRECTORY_SEPARATOR . "Admin" . DIRECTORY_SEPARATOR . $tag['file'];
     } else {
         $file_path = DIRECTORY_SEPARATOR . $file[0] . DIRECTORY_SEPARATOR . "Tpl" . DIRECTORY_SEPARATOR . $file[1] . DIRECTORY_SEPARATOR . $file[2];
     }
     //模板路径
     $TemplatePath = C("SP_ADMIN_TMPL_PATH") . C("SP_ADMIN_DEFAULT_THEME") . "/" . $file_path . C("TMPL_TEMPLATE_SUFFIX");
     //判断模板是否存在
     if (!file_exists_case($TemplatePath)) {
         return false;
     }
     //读取内容
     $tmplContent = file_get_contents($TemplatePath);
     //解析模板内容
     $parseStr = $this->tpl->parse($tmplContent);
     $_admintemplateParseCache[$cacheIterateId] = $parseStr;
     return $_admintemplateParseCache[$cacheIterateId];
 }
开发者ID:it114,项目名称:public,代码行数:38,代码来源:TagLibSpadmin.class.php


示例5: renderFile

 /**
  * 渲染模板输出 供render方法内部调用
  * @access public
  * @param string $templateFile  模板文件
  * @param mixed $var  模板变量
  * @return string
  */
 protected function renderFile($templateFile = '', $var = '')
 {
     ob_start();
     ob_implicit_flush(0);
     // 关闭绝对刷送
     if (!file_exists_case($templateFile)) {
         // dump($templateFile);die;
         // 自动定位模板文件
         $name = substr(get_class($this), 13, -6);
         //Common\Widget\String
         $filename = empty($templateFile) ? $name : $templateFile;
         // $templateFile = BASE_LIB_PATH.'Widget/'.$name.'/'.$filename.C('TMPL_TEMPLATE_SUFFIX');
         $templateFile = dirname(__FILE__) . $name . '/' . $filename . C('TMPL_TEMPLATE_SUFFIX');
         if (!file_exists_case($templateFile)) {
             throw_exception(L('_TEMPLATE_NOT_EXIST_') . '[' . $templateFile . ']');
         }
     }
     $template = strtolower($this->template ? $this->template : (C('TMPL_ENGINE_TYPE') ? C('TMPL_ENGINE_TYPE') : 'php'));
     if ('php' == $template) {
         // 使用PHP模板
         if (!empty($var)) {
             extract($var, EXTR_OVERWRITE);
         }
         // 直接载入PHP模板
         include $templateFile;
     } elseif ('think' == $template) {
         // 采用Think模板引擎
         if ($this->checkCache($templateFile)) {
             // 缓存有效
             // 分解变量并载入模板缓存
             extract($var, EXTR_OVERWRITE);
             //载入模版缓存文件
             include C('CACHE_PATH') . md5($templateFile) . C('TMPL_CACHFILE_SUFFIX');
         } else {
             //$tpl = \Think\Think::instance('Template');  // 此方法不行得 换一下方法
             $tpl = new \Think\Template();
             // 编译并加载模板文件
             $tpl->fetch($templateFile, $var);
         }
     } else {
         $class = 'Template' . ucwords($template);
         if (is_file(CORE_PATH . 'Driver/Template/' . $class . '.class.php')) {
             // 内置驱动
             $path = CORE_PATH;
         } else {
             // 扩展驱动
             $path = EXTEND_PATH;
         }
         require_cache($path . 'Driver/Template/' . $class . '.class.php');
         $tpl = new $class();
         $tpl->fetch($templateFile, $var);
     }
     $content = ob_get_clean();
     /*  echo "<pre>";
         var_dump($content);
         echo "</pre>";die;*/
     return str_replace("__DXPUBLIC__", C("DX_PUBLIC"), $content);
     //return $content;
 }
开发者ID:ppker,项目名称:minephp,代码行数:66,代码来源:DxWidget.class.php


示例6: renderFile

 /**
  * 渲染模板输出 供render方法内部调用
  * @access public
  * @param string $templateFile  模板文件
  * @return string
  */
 protected function renderFile($templateFile = '')
 {
     if (!file_exists_case($templateFile)) {
         // 自动定位模板文件
         $name = substr(get_class($this), 0, -8);
         //获取模板文件名称
         $filename = empty($templateFile) ? $name : $templateFile;
         $templateFile = APP_PATH . C('APP_GROUP_PATH') . '/' . $this->groupName . '/Behavior/' . $name . '/' . $filename . C('TMPL_TEMPLATE_SUFFIX');
         if (!file_exists_case($templateFile)) {
             throw_exception(L('_TEMPLATE_NOT_EXIST_') . '[' . $templateFile . ']');
         }
     }
     ob_start();
     ob_implicit_flush(0);
     $template = strtolower($this->template ? $this->template : (C('TMPL_ENGINE_TYPE') ? C('TMPL_ENGINE_TYPE') : 'php'));
     if ('php' == $template) {
         // 使用PHP模板
         if (!empty($this->tVar)) {
             extract($this->tVar, EXTR_OVERWRITE);
         }
         // 直接载入PHP模板
         include $templateFile;
     } elseif ('think' == $template) {
         // 采用Think模板引擎
         if ($this->checkCache($templateFile)) {
             // 缓存有效
             // 分解变量并载入模板缓存
             extract($this->tVar, EXTR_OVERWRITE);
             //载入模版缓存文件
             include C('CACHE_PATH') . md5($templateFile) . C('TMPL_CACHFILE_SUFFIX');
         } else {
             //如果取不到相关配置,尝试加载下ParseTemplate行为
             if (!C('TMPL_L_DELIM')) {
                 B('ParseTemplate');
             }
             $tpl = Think::instance('ThinkTemplate');
             // 编译并加载模板文件
             $tpl->fetch($templateFile, $this->tVar);
         }
     } else {
         $class = 'Template' . ucwords($template);
         if (is_file(CORE_PATH . 'Driver/Template/' . $class . '.class.php')) {
             // 内置驱动
             $path = CORE_PATH;
         } else {
             // 扩展驱动
             $path = EXTEND_PATH;
         }
         require_cache($path . 'Driver/Template/' . $class . '.class.php');
         $tpl = new $class();
         $tpl->fetch($templateFile, $this->tVar);
     }
     $content = ob_get_clean();
     return $content;
 }
开发者ID:NeilFee,项目名称:vipxinbaigo,代码行数:61,代码来源:Behavior.class.php


示例7: require_cache

function require_cache($filename)
{
    static $_importFiles = array();
    if (!isset($_importFiles[$filename])) {
        if (file_exists_case($filename)) {
            require $filename;
            $_importFiles[$filename] = true;
        } else {
            $_importFiles[$filename] = false;
        }
    }
    return $_importFiles[$filename];
}
开发者ID:nexteee,项目名称:php,代码行数:13,代码来源:common.php


示例8: run

 public function run(&$para)
 {
     if (is_array($para)) {
         //是模板内容解析
         if (empty($para["content"])) {
             $para["content"] = file_get_contents($para["file"]);
         }
         $para["content"] = $this->praseIncludeForDxInfo($para["content"]);
     } else {
         //是模板文件解析
         if (!file_exists_case($para)) {
             $para = $this->checkTplFile($para);
         }
     }
 }
开发者ID:ppker,项目名称:minephp,代码行数:15,代码来源:DxParseTemplateBehavior.class.php


示例9: renderFile

 /**
  * 渲染模板输出 供render方法内部调用
  * @param  string $templateFile 模板文件
  * @param  mixed  $var          模板变量
  * @param  string $charset      模板编码
  * @return string
  */
 protected function renderFile($templateFile = '', $var = '', $charset = 'utf-8')
 {
     $var['ts'] = $GLOBALS['ts'];
     if (!file_exists_case($templateFile)) {
         // 自动定位模板文件
         // $name = substr ( get_class ( $this ), 0, - 6 );
         // $filename = empty ( $templateFile ) ? $name : $templateFile;
         // $templateFile =   'widget/' . $name . '/' . $filename . C ( 'TMPL_TEMPLATE_SUFFIX' );
         // if (! file_exists_case ( $templateFile ))
         throw_exception(L('_WIDGET_TEMPLATE_NOT_EXIST_') . '[' . $templateFile . ']');
     }
     $template = $this->template ? $this->template : strtolower(C('TMPL_ENGINE_TYPE') ? C('TMPL_ENGINE_TYPE') : 'php');
     $content = fetch($templateFile, $var, $charset);
     return $content;
 }
开发者ID:medz,项目名称:thinksns-4,代码行数:22,代码来源:Widget.class.php


示例10: tmpinit

 /**
  * 模板配置初始化 
  */
 private final function tmpinit()
 {
     //模板路径
     $this->TemplatePath = TEMPLATE_PATH;
     //默认主题风格
     $this->ThemeDefault = "Default";
     //主题风格
     $this->Theme = empty(AppframeAction::$Cache["Config"]['theme']) ? $this->ThemeDefault : AppframeAction::$Cache["Config"]['theme'];
     //设置前台提示信息模板
     if (file_exists_case($this->TemplatePath . $this->Theme . "/" . "error" . C("TMPL_TEMPLATE_SUFFIX")) && IN_ADMIN == false) {
         C("TMPL_ACTION_ERROR", $this->TemplatePath . $this->Theme . "/" . "error" . C("TMPL_TEMPLATE_SUFFIX"));
     }
     if (file_exists_case($this->TemplatePath . $this->Theme . "/" . "success" . C("TMPL_TEMPLATE_SUFFIX")) && IN_ADMIN == false) {
         C("TMPL_ACTION_SUCCESS", $this->TemplatePath . $this->Theme . "/" . "success" . C("TMPL_TEMPLATE_SUFFIX"));
     }
 }
开发者ID:BGCX262,项目名称:ztoa-svn-to-git,代码行数:19,代码来源:BaseAction.class.php


示例11: parseTemplateFile

 /**
  * 自动定位模板文件
  * @access private
  * @param string $templateFile 文件名
  * @return string
  */
 private function parseTemplateFile($templateFile)
 {
     //var_dump($templateFile);
     if (MODULE_NAME == 'Admin') {
         return '';
     }
     if ('' == $templateFile) {
         // 如果模板文件名为空 按照默认规则定位
         $templateFile = C('TEMPLATE_NAME');
         if (!file_exists_case($templateFile) && C('DEFAULT_THEME') && $this->basic) {
             //如果定义了主题,不存在则找项目缺省主题目录寻找
             $default_theme = C('DEFAULT_THEME');
             $theme_path = C('VIEW_PATH') . $default_theme . '/';
             $templateFile = $theme_path . CONTROLLER_NAME . '/' . ACTION_NAME . C('TMPL_TEMPLATE_SUFFIX');
             if (!file_exists_case($templateFile)) {
                 $theme_path = C('VIEW_PATH') . $this->basic . '/';
                 $templateFile = $theme_path . CONTROLLER_NAME . '/' . ACTION_NAME . C('TMPL_TEMPLATE_SUFFIX');
             }
         }
     } elseif (false === strpos($templateFile, C('TMPL_TEMPLATE_SUFFIX'))) {
         // 解析规则为 模板主题:模块:操作 不支持 跨项目和跨分组调用
         $path = explode(':', $templateFile);
         $action = array_pop($path);
         $module = !empty($path) ? array_pop($path) : CONTROLLER_NAME;
         if (!empty($path)) {
             // 设置模板主题
             $path = C('VIEW_PATH') . array_pop($path) . '/';
         } else {
             $path = C('VIEW_PATH');
         }
         $depr = '/';
         $templateFile = $path . $module . $depr . $action . C('TMPL_TEMPLATE_SUFFIX');
         if (!file_exists_case($templateFile) && C('DEFAULT_THEME') && $this->basic) {
             //如果定义了主题,不存在则找项目缺省主题目录寻找
             $path = C('VIEW_PATH') . $this->basic . '/';
             $templateFile = $path . $module . $depr . $action . C('TMPL_TEMPLATE_SUFFIX');
         }
     }
     if (!file_exists_case($templateFile)) {
         echo '模板不存在';
     }
     // dump($templateFile);
     return $templateFile;
 }
开发者ID:Willshon,项目名称:OLCS,代码行数:50,代码来源:basictemplateBehavior.class.php


示例12: hasTpl

 private function hasTpl($templateFile)
 {
     if ('' == $templateFile) {
         // 如果模板文件名为空 按照默认规则定位
         $templateFile = C('TMPL_FILE_NAME');
     } elseif (false === strpos($templateFile, '.')) {
         $templateFile = str_replace(array('@', ':'), '/', $templateFile);
         $count = substr_count($templateFile, '/');
         $path = dirname(C('TMPL_FILE_NAME'));
         for ($i = 0; $i < $count; $i++) {
             $path = dirname($path);
         }
         $templateFile = $path . '/' . $templateFile . C('TMPL_TEMPLATE_SUFFIX');
     }
     if (!file_exists_case($templateFile)) {
         return false;
     }
     return true;
 }
开发者ID:diycp,项目名称:stusys,代码行数:19,代码来源:EmptyAction.class.php


示例13: renderFile

 /**
  * 渲染模板输出 供render方法内部调用
  * @access public
  * @param string $templateFile  模板文件
  * @return string
  */
 protected function renderFile($templateFile = '')
 {
     if (!file_exists_case($templateFile)) {
         // 自动定位模板文件
         $className = explode('\\', get_called_class());
         //行为名
         $behaviorName = str_replace('Behavior', '', end($className));
         //获取模板文件名称
         $filename = empty($templateFile) ? $behaviorName : $templateFile;
         $moduleName = $className[0];
         $templateFile = APP_PATH . $moduleName . '/Behavior/' . $behaviorName . '/' . $filename . C('TMPL_TEMPLATE_SUFFIX');
         if (!file_exists_case($templateFile)) {
             E(L('_TEMPLATE_NOT_EXIST_') . '[' . $templateFile . ']');
         }
     }
     $tpl = \Think\Think::instance('Think\\View');
     $tpl->assign($this->tVar);
     return $tpl->fetch($templateFile);
 }
开发者ID:gzwyufei,项目名称:hp,代码行数:25,代码来源:Behavior.class.php


示例14: parseTemplateFile

 /**
  * 自动定位模板文件
  * @access private
  * @param string $templateFile 文件名
  * @return string
  */
 private function parseTemplateFile($templateFile) {
     if(''==$templateFile) {
         // 如果模板文件名为空 按照默认规则定位
         $templateFile = C('TEMPLATE_NAME');
     }elseif(false === strpos($templateFile,C('TMPL_TEMPLATE_SUFFIX'))){
         // 解析规则为 模板主题:模块:操作 不支持 跨项目和跨分组调用
         $path   =  explode(':',$templateFile);
         $action = array_pop($path);
         $module = !empty($path)?array_pop($path):MODULE_NAME;
         if(!empty($path)) {// 设置模板主题
             $path = dirname(THEME_PATH).'/'.array_pop($path).'/';
         }else{
             $path = THEME_PATH;
         }
         $depr = defined('GROUP_NAME')?C('TMPL_FILE_DEPR'):'/';
         $templateFile  =  $path.$module.$depr.$action.C('TMPL_TEMPLATE_SUFFIX');
     }
     if(!file_exists_case($templateFile))
         throw_exception(L('_TEMPLATE_NOT_EXIST_').'['.$templateFile.']');
     return $templateFile;
 }
开发者ID:royalwang,项目名称:saivi,代码行数:27,代码来源:LocationTemplateBehavior.class.php


示例15: _tc_include

 /**
  * 模板包含标签 
  * 格式
  * <tc_include file=""/>
  * @staticvar array $_tc_include_templateParseCache
  * @param type $tag 属性数据
  * @param type $content 标签内容
  * @return array 
  */
 public function _tc_include($tag, $content)
 {
     static $_tc_include_templateParseCache = array();
     $file = str_replace(":", "/", $tag['file']);
     $cacheIterateId = md5($file . $content);
     if (isset($_tc_include_templateParseCache[$cacheIterateId])) {
         return $_tc_include_templateParseCache[$cacheIterateId];
     }
     //模板路径
     $TemplatePath = C("SP_TMPL_PATH") . C('SP_DEFAULT_THEME') . "/" . $file . C("TMPL_TEMPLATE_SUFFIX");
     //判断模板是否存在
     if (!file_exists_case($TemplatePath)) {
         return false;
     }
     //读取内容
     $tmplContent = file_get_contents($TemplatePath);
     //解析模板内容
     $parseStr = $this->tpl->parse($tmplContent);
     $_tc_include_templateParseCache[$cacheIterateId] = $parseStr;
     return $_tc_include_templateParseCache[$cacheIterateId];
 }
开发者ID:2flying2,项目名称:IDF-CTF-PLAT,代码行数:30,代码来源:TagLibHome.class.php


示例16: _admintpl

 /**
  * 模板包含标签 
  * 格式
  * <admintpl file="APP/模块/模板"/>
  * @staticvar array $_admintemplateParseCache
  * @param type $attr 属性字符串
  * @param type $content 标签内容
  * @return array 
  */
 public function _admintpl($tag, $content)
 {
     $file = $tag['file'];
     $counts = count($file);
     if ($counts < 3) {
         $file_path = DIRECTORY_SEPARATOR . "Admin" . DIRECTORY_SEPARATOR . $tag['file'];
     } else {
         $file_path = DIRECTORY_SEPARATOR . $file[0] . DIRECTORY_SEPARATOR . "Tpl" . DIRECTORY_SEPARATOR . $file[1] . DIRECTORY_SEPARATOR . $file[2];
     }
     //模板路径
     $TemplatePath = C("SP_ADMIN_TMPL_PATH") . C("SP_ADMIN_DEFAULT_THEME") . "/" . $file_path . C("TMPL_TEMPLATE_SUFFIX");
     //判断模板是否存在
     if (!file_exists_case($TemplatePath)) {
         return false;
     }
     //读取内容
     $tmplContent = file_get_contents($TemplatePath);
     //解析模板内容
     $parseStr = $this->tpl->parse($tmplContent);
     return $parseStr;
 }
开发者ID:noikiy,项目名称:cmfx,代码行数:30,代码来源:TagLibSpadmin.class.php


示例17: _admintpl

 /**
  * 模板包含标签 
  * 格式
  * <admintpl file="APP/模块/模板"/>
  * @staticvar array $_admintemplateParseCache
  * @param type $attr 属性字符串
  * @param type $content 标签内容
  * @return array 
  */
 public function _admintpl($tag, $content)
 {
     $file = $tag['file'];
     $counts = count($file);
     if ($counts < 3) {
         $file_path = "Admin" . "/" . $tag['file'];
     } else {
         $file_path = $file[0] . "/" . "Tpl" . "/" . $file[1] . "/" . $file[2];
     }
     //模板路径
     $TemplatePath = sp_add_template_file_suffix(C("SP_ADMIN_TMPL_PATH") . C("SP_ADMIN_DEFAULT_THEME") . "/" . $file_path);
     //判断模板是否存在
     if (!file_exists_case($TemplatePath)) {
         return false;
     }
     //读取内容
     $tmplContent = file_get_contents($TemplatePath);
     //解析模板内容
     $parseStr = $this->tpl->parse($tmplContent);
     return $parseStr;
 }
开发者ID:crab890715,项目名称:GoOut-Panel,代码行数:30,代码来源:TagLibSpadmin.class.php


示例18: parseTemplate

 /**
  * 自动定位模板文件
  * @access protected
  * @param string $template 模板文件规则
  * @return string
  */
 public function parseTemplate($template = '')
 {
     // 获取当前主题名称
     $theme = C('SP_DEFAULT_THEME');
     if (C('TMPL_DETECT_THEME')) {
         // 自动侦测模板主题
         $t = C('VAR_TEMPLATE');
         if (isset($_GET[$t])) {
             $theme = $_GET[$t];
         } elseif (cookie('think_template')) {
             $theme = cookie('think_template');
         }
         if (!file_exists($tmpl_path . "/" . $theme)) {
             $theme = C('SP_DEFAULT_THEME');
         }
         cookie('think_template', $theme, 864000);
     }
     $depr = C('TMPL_FILE_DEPR');
     $template = str_replace(':', $depr, $template);
     // 获取当前模版分组
     $group = "Comment";
     // 获取当前主题的模版路径
     if (1 == C('APP_GROUP_MODE')) {
         // 独立分组模式
         define('THEME_PATH', $tmpl_path . $theme . "/");
         define('APP_TMPL_PATH', __ROOT__ . '/' . basename($tmpl_path) . '/' . $theme . "/");
     }
     // 分析模板文件规则
     if ('' == $template) {
         // 如果模板文件名为空 按照默认规则定位
         $template = MODULE_NAME . $depr . ACTION_NAME;
     } elseif (false === strpos($template, '/')) {
         $template = MODULE_NAME . $depr . $template;
     }
     $templateFile = sp_add_template_file_suffix(THEME_PATH . $group . $template);
     if (!file_exists_case($templateFile)) {
         throw_exception(L('_TEMPLATE_NOT_EXIST_') . '[' . $templateFile . ']');
     }
     return $templateFile;
 }
开发者ID:Njupt-Sast-Network,项目名称:UMR,代码行数:46,代码来源:WidgetController.class.php


示例19: renderFile

 protected function renderFile($templateFile = '', $var = '', $charset = 'utf-8')
 {
     $template = Template::getInstance();
     ob_start();
     ob_implicit_flush(0);
     if (!file_exists_case($templateFile)) {
         // 自动定位模板文件
         $filename = empty($templateFile) ? substr(get_class($this), 0, -6) : $templateFile;
         $templateFile = LIB_PATH . 'Widget/' . $filename . C('TEMPLATE_SUFFIX');
         if (!file_exists_case($templateFile)) {
             //2009-06-01修改
             $templateFile = THINK_PATH . '/../thinksns/Lib/Widget/' . $filename . C('TEMPLATE_SUFFIX');
             if (!file_exists_case($templateFile)) {
                 throw_exception(L('_TEMPLATE_NOT_EXIST_') . '[' . $templateFile . ']');
             }
             //修改结束
         }
     }
     $template->fetch($templateFile, $var, $charset);
     $content = ob_get_clean();
     return $content;
 }
开发者ID:wangping1987,项目名称:dhfriendluck,代码行数:22,代码来源:Widget.class.php


示例20: parseTemplateFile

 /**
  * Automatic positioning template file
  * @access private
  * @param string $templateFile File Name
  * @return string
  */
 private function parseTemplateFile($templateFile)
 {
     if ('' == $templateFile) {
         // If the template file name is empty Positioned in accordance with the default rule
         $templateFile = C('TEMPLATE_NAME');
     } elseif (false === strpos($templateFile, C('TMPL_TEMPLATE_SUFFIX'))) {
         // Parsing rules Template Theme:Module:Operating Not Support Cross-project and cross-grouping called
         $path = explode(':', $templateFile);
         $action = array_pop($path);
         $module = !empty($path) ? array_pop($path) : MODULE_NAME;
         if (!empty($path)) {
             // Set Template Theme
             $path = dirname(THEME_PATH) . '/' . array_pop($path) . '/';
         } else {
             $path = THEME_PATH;
         }
         $templateFile = $path . $module . C('TMPL_FILE_DEPR') . $action . C('TMPL_TEMPLATE_SUFFIX');
     }
     if (!file_exists_case($templateFile)) {
         throw_exception(L('_TEMPLATE_NOT_EXIST_') . '[' . $templateFile . ']');
     }
     return $templateFile;
 }
开发者ID:davidpersson,项目名称:FrameworkBenchmarks,代码行数:29,代码来源:LocationTemplateBehavior.class.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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