Home > Backend Development > PHP Tutorial > ThinkPHP让../Public在模板不解析(直接输出)的方法[原创]_php实例

ThinkPHP让../Public在模板不解析(直接输出)的方法[原创]_php实例

WBOY
Release: 2016-05-16 20:06:48
Original
1054 people have browsed it

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

问题:

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

解决方法:

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

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

Copy after login

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

更多关于thinkPHP相关内容感兴趣的读者可查看本站专题:《ThinkPHP入门教程》及《ThinkPHP常用方法总结

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

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