The following is a description of Several import operations. 1. Usage 1.
Import ('@. Test. translate'); @, indicating the project root directory. Assume that the root directory is: App/import class library path is: App/Lib/Test/Translate. class. php. Conclusion: import ('@') is relative to the Lib directory of the project directory.
2. Usage 2
Import ('Think. Test. translate'); Think, indicating the system root directory. Not only :. /ThinkPHP/the path to import the class library is :. /ThinkPHP/Lib/Test/Translate. class. php conclusion: import ('think') is relative to the Lib directory of the system directory.
3. Usage 3
Import ('org. test. translate '); or import ('com. test. translate '); ORG, the third-party public class library directory COM, and the enterprise public class library directory are both relative. /ThinkPHP/Extend/Library. The path to import the class library is :. /ThinkPHP/Extend/Library/ORG/Test/Translate. class. php or the path for importing the 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 4
Import ('blog. Test. translate'); this method is neither @ nor Think, nor ORG or COM, and will be processed as the project directory of the group. The resolution result is App/../Blog/Lib/Test/Translate. class. php. Conclusion: The fourth method is relative to the Lib directory of the group project directory.
5. Usage 5
Import also supports alias import. To import aliases, first define the alias file and create alias. php under the project configuration directory to define the class library alias to be used in the project.
Return array ('page' => LIB_PATH. 'common/page. class. php',); // you can use this method to import ('page ');