In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains the "ThinkPHP default template replacement rules", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "ThinkPHP default template replacement rules"!
This paper describes the replacement of ThinkPHP templates and system constants and applications, which are the basic knowledge of ThinkPHP project development and need to be firmly mastered. The details are as follows:
Default template replacement rules:
.. / Public: the common template directory that will be replaced with the current project is usually / project directory / Tpl/default/Public/
_ _ PUBLIC__: will be replaced with the public directory of the current website, usually / Public/
_ _ TMPL__: the template directory that will be replaced by the project is usually / project directory / Tpl/default/
_ _ ROOT__: will be replaced with the address of the current website (excluding domain name)
_ _ APP__: will be replaced with the URL address of the current project (excluding domain name)
_ _ URL__: will be replaced with the URL address of the current module (excluding domain name)
_ _ ACTION__: will be replaced with the URL address of the current operation (excluding domain name)
_ _ SELF__: will be replaced with the current page URL
You can also customize replacement rules by configuring the value of TMPL_PARSE_STRING in the project configuration file, such as:
TMPL_PARSE_STRING = > array ('_ PUBLIC__' = >'/ Common', / / change the default _ PUBLIC__ replacement rule'_ _ UPLOAD__' = >'/ Public/Uploads/', / / add a new upload path replacement rule)
Example:
File path: / Home/Tpl/default/User/index.html, the code is as follows:
_ _ ROOT__ represents the URL of the current website
_ _ URL__ represents the URL address / index.php/User of the current module
.. / Public representative / aoli/Tpl/default/Public
_ _ PUBLIC__ represents the project public file directory / Public
_ _ TMPL__ represents the template directory / aoli/Tpl/default/ of the current project
_ _ APP__ represents the entry file address / index.php of the current project
_ _ ACTION__ represents the current operating address / index.php/User/index
_ _ SELF__ represents the current URL address / index.php/User/
_ _ UPLOAD__
File path: / Home/Lib/Action/UserAction.class.php, the code is as follows:
Access path: http://localhost/index.php/User/index input content, click the registration button and jump to http://localhost/index.php/User/add and execute the add method under the User module to output the submitted content.
Thank you for your reading, the above is the content of "ThinkPHP default template replacement rules", after the study of this article, I believe you have a deeper understanding of the problem of ThinkPHP default template replacement rules, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.