Here are a few usages of import
1. Usage One
Import (' @. Test.translate ');
@, which represents the project root directory. Assume that the root directory is: app/
The path to the Import class library is: app/lib/test/translate.class.php
Conclusion: Import (' @ ') is relative to the Lib directory of the project directory
2. Usage Two
Import (' Think.Test.Translate ');
A Think that represents the system root directory. Both:./thinkphp/
The path to the Import class library is:./thinkphp/lib/test/translate.class.php
Conclusion: Import (' Think ') is relative to the Lib directory of the system directory
3. Usage Three
Import (' ORG. Test.translate ');
Or
Import (' COM. Test.translate ');
ORG, third-party public class Library directory
COM, Enterprise public class Library Directory
Both of these are written in relation to./thinkphp/extend/library/.
The path to the Import class library is:./thinkphp/extend/library/org/test/translate.class.php
Or
The path to the Import class library is:./thinkphp/extend/library/com/test/translate.class.php
Conclusion: Import (' ORG ') or import (' COM ') is relative to the system Extension Class Library directory (./thinkphp/extend/library/)
4. Usage Four
Import (' Blog.Test.Translate ');
This type of writing is neither a @,think, nor a org,com, but is treated as a grouped project directory.
The parse result is: app/. /blog/lib/test/translate.class.php
Conclusion: The fourth way of writing is relative to the Lib directory of the grouped items directory.
5. Usage Five
Import also supports alias import, using alias import, first define the alias file, establish alias.php in the project configuration directory, define the class library alias to be used in the project.
Return Array (' page ' = Lib_path ' common/page.class.php ',);//This can be used to import (' page ');
http://www.bkjia.com/PHPjc/824662.html www.bkjia.com true http://www.bkjia.com/PHPjc/824662.html techarticle The following is attached to the import of several usage introduction 1, the usage of an import (' @. Test.translate '); @, which represents the project root directory. Assume that the root directory is: app/the path to the imported class library is: App/lib/test/transl ...