PHP头条
热点:

thinkphp中display()方法实现的原理


看下这段代码 thinkphp教程 中可能没有介绍,我们要深入的了解tp把tp转化为自己的项目要需要很大的精力去探讨一下

private function parseTemplateFile($templateFile) {

 

// Lite模式没有模板主题的概念 if(''==$templateFile) {

 

 // 如果模板文件名为空 按照默认规则定位 $templateFile = TMPL_PATH.MODULE_NAME.'/'.ACTION_NAME.C('TMPL_TEMPLATE_SUFFIX');

 

}elseif(strpos($templateFile,':')){

 

// 引入其它模块的操作模板 $templateFile = TMPL_PATH.str_replace(':','/',$templateFile).C('TMPL_TEMPLATE_SUFFIX'); }elseif(!is_file($templateFile)) { // 引入当前模块的其它操作模板 $templateFile = TMPL_PATH.MODULE_NAME.'/'.$templateFile.C('TMPL_TEMPLATE_SUFFIX'); } if(!file_exists_case($templateFile)) throw_exception(L('_TEMPLATE_NOT_EXIST_').'['.$templateFile.']'); return $templateFile; }

www.phpzy.comtrue/phpkj/10115.htmlTechArticlethinkphp中display()方法实现的原理 看下这段代码 thinkphp教程中可能没有介绍,我们要深入的了解tp把tp转化为自己的项目要需要很大的精力去探讨一下 private function parseTemplateFile($templateFi...

相关文章

相关频道:

PHP之友评论

今天推荐