In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you there are several ways to use import in Thinkphp, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
1. Method of use
Import ('@ .Test.Translate'); @, which represents the project root folder. Suppose the root folder is: App/ the path to import the class library is: App/Lib/Test/Translate.class.php conclusion: import ('@') is relative to the Lib folder of the project folder
2. Method of use 2
Import ('Think.Test.Translate'); Think, which represents the system root folder.
3. Method of use 3
Import ('ORG.Test.Translate'); or import (' COM.Test.Translate'); ORG, third-party public class library folder COM, enterprise public class library folder are both written relative to. / ThinkPHP/Extend/Library/. The path to import the class library is:. / ThinkPHP/Extend/Library/ORG/Test/Translate.class.php or the path to import 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 folder (. / ThinkPHP/Extend/Library/)
4. Method of use 4
Import ('Blog.Test.Translate'); this is not @. The way Think is written is not ORG. The way COM is written. Will be treated as grouped project folders. The result of the analysis is: App/../Blog/Lib/Test/Translate.class.php conclusion: the fourth method of writing is relative to the Lib folder of the grouped project folder.
5. Method of use 5
Import also supports alias import. To import using an alias, first define the alias file. Create an alias.php under the project configuration folder to define the class library aliases to be used in the project.
Return array ('page' = > LIB_PATH.'Common/page.class.php',); / / in this way, you can import (' page'). The above is all the content of this article entitled "there are several ways to use import in Thinkphp". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.