当前位置:网站首页>Several methods of importing ThinkPHP
Several methods of importing ThinkPHP
2022-06-12 10:26:00 【We met at the edge of the mountain】
import(' Class library name ', ' Starting path ', ' Class library suffix ')
import('@.Test.Translate');
@, Represents the project root . Suppose the root directory is :App/
The path to import the class library is :App/Lib/Test/Translate.class.php
Conclusion :import('@') Is relative to the project directory Lib In terms of catalogue
Loader::import(' route ', EXTEND_PATH);
// Helper functions
import(' route ', EXTEND_PATH);
EXTEND_PATH thinkphp The default is a third-party directory extend
import('Think') Is relative to the system directory Lib In terms of catalogue
import('ORG') or import('COM') It is relative to the system extension class library directory (./ThinkPHP/Extend/Library/)
Points can be used in the middle of the path to link such as a/b It can be used a.b
include
Include and run the specified file . The included file is first searched according to the path given by the parameter , If no directory is given ( Only the filename ) When it comes to include_path The specified directory looks for .
If in include_path If the file is not found, then include Finally, we find it in the directory where the script file is called and the current working directory . If the file is not found in the end include
The structure will issue a warning about this and require Different , The latter will make a fatal error
require The two methods are similar The main difference is that fatal errors are reported
include_once,require_once The only difference is PHP Will check if the file has been included , If so, it will not contain .
边栏推荐
- CONDA install tensorflow test tensorflow
- Chromebook system without anti-virus software
- 淘宝618超级喵运会怎么玩?超级喵运会整体活动攻略来了
- 学生管理系统
- 一测两三年,记测试交流经验的一些感想
- 验收标准到底是不是测试用例?
- MySQL VI Database lock
- [chromium] location information kernel debugging
- Checkpoint of the four cornerstones of Flink
- How to refund the pre-sale deposit of JD 618 in 2022? Can JD 618 deposit be refunded?
猜你喜欢

MySQL 4 Database table storage structure & tablespace

How to refund the pre-sale deposit of JD 618 in 2022? Can JD 618 deposit be refunded?

验收标准到底是不是测试用例?

pycharm 查看opencv当前的版本

A snare - Cookie spoofing

A hundred secrets and a few secrets - Caesar encryption

Circuitbreaker fuse of resilience4j -- Measurement of circuitbreakermetrics index

JVM (V) Virtual machine class loading (parental delegation mechanism)

How to play the 2022 Taobao 618 Super Cat Games? Playing skills of 2022 Taobao 618 Cat Games

Love and hate in the Jianghu
随机推荐
一测两三年,记测试交流经验的一些感想
MySQL III Configuration file & log file
The difference between static method locking and non static method locking
MySQL user and permission management, role management
看看你有没有陷入“标签化”客户和 用户 的陷阱?
[Wayland] Wayland agreement description
[CEGUI] window environment compilation
High performance computing framework for image processing
Antique mfc/gdi+ Frame LCD display control
PHP: seven cattle cloud upload file
pycharm 查看opencv当前的版本
Remote link software xshell and xftp download address
JVM (IV) Class file structure (complete parsing of bytecode attached)
[926. flip the string to monotonic increment]
Solution to the problem that the applet developer tool cannot input simplified Chinese
FPGA VGA display based on de2-115 platform
PostgreSQL uses stored procedures to splice multiple tables and query data
Chromebook system without anti-virus software
[DDS] dds-rpc implementation based on opendds
Mqtt protocol Chinese version