ThinkPHP中公共函数路径和配置项路径的映射分析,thinkphp函数
本文实例分析了ThinkPHP中公共函数路径和配置项路径的映射。分享给大家供大家参考。具体分析如下:
ThinkPHP中在使用公共函数时(单一入口文件对应独立的项目),在Common文件夹中可以写公共的函数文件,写成文件名为common.php的文件会被系统自动加载,如果写成其他的函数名,则不会自动加载,但是有两种处理机制
1、在使用的时候手动加载 load('@.function');这样就会手动加载这个文件。@代表是在这个项目下的Common文件夹下的。
2、在配置文件中配置
复制代码 代码如下:
'LOAD_EXT_FILE' => 'function'
在ThinkPHP中__PUBLICC__这个不是一个常量,而是一个映射,默认是在最根目录下的Public目录,可以在配置文件中修改,
复制代码 代码如下:
'TMPL_PARSE_STRING' => __ROOT__.'Public'
希望本文所述对大家的ThinkPHP框架程序设计有所帮助。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1
Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.