This article mainly introduces ThinkPHP's method of making cmstplIndexPublic output directly without parsing the template. it involves the technique of modifying the default variable replacement through template constant settings and has some reference value, for more information about how ThinkPHP does not parse the template, see the examples in this article. Share it with you for your reference. The details are as follows:
Problem:
The template contains/cms/tpl/Index/Public and needs to be output directly, but/cms/tpl/Index/Public will be directly replaced with the current Public Template directory, and the final output is: /project directory/Tpl/default/Public/
Solution:
Add Template constant settings in config. php:
'Tmpl _ PARSE_STRING '=> array ('/cms/tpl/Index/public' => "/cms/tpl/Index/Public ",) // the string to be automatically replaced by the template engine, which must be an array.
Set/cms/tpl/Index/Public to the original output.