ThinkPHP让../Public在模板不解析(直接输出)的方法 原创,thinkphpfont_PHP教程

WBOY
Release: 2016-07-12 09:08:03
Original
934 people have browsed it

ThinkPHP让../Public在模板不解析(直接输出)的方法 原创,thinkphpfont

本文实例讲述了ThinkPHP让../Public在模板不解析的方法。分享给大家供大家参考。具体如下:

问题:

模板中包含../Public需要直接输出,但是../Public会被直接替换为当前公共模板目录,最终输出为:/项目目录/Tpl/default/Public/

解决方法:

在配置文件config.php中添加模板常量设置:

'TMPL_PARSE_STRING' => array(
 '../Public' =>"../Public",
) // 模板引擎要自动替换的字符串,必须是数组形式。

Copy after login

这里将../Public设置成原样输出即可。

希望本文所述对大家的ThinkPHP程序设计有所帮助。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1058138.htmlTechArticleThinkPHP让../Public在模板不解析(直接输出)的方法 原创,thinkphpfont 本文实例讲述了ThinkPHP让../Public在模板不解析的方法。分享给大家供大家参...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!