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, see
This article mainly introduces ThinkPHP's method of making/cms/tpl/Index/Public directly output without parsing the template. It involves the technique of modifying the default variable replacement through the template constant setting, it has some reference value. For more information, see
This example describes how ThinkPHP does not parse the template by making/cms/tpl/Index/Public. 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. However,/cms/tpl/Index/Public is 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.
I hope this article will help you with ThinkPHP programming.