Definition of constant addresses in the TP framework

Source: Internet
Author: User
For the TP framework's definition of constant addresses, please help the heroes. thank you.




Reply to discussion (solution)

TP is annoying, with a large number of broken people

Php constants cannot be placed in strings!
Put it in a string as a character

TP uses strings to replace the pseudo constants created, confusing many people

TP is annoying, with a large number of broken people

Php constants cannot be placed in strings!
Put it in a string as a character

TP uses strings to replace the pseudo constants created, confusing many people



I tried a few times but it is still not easy to use. maybe I didn't understand what you mean. I am a newbie. please give an example.

What is the output using the code {$ Think. const. IMG_URL} above?

Http://www.thinkphp1.cn/topic/10043.html

Check whether the config file is defined?

What is the output using the code {$ Think. const. IMG_URL} above?

Http://www.thinkphp1.cn/topic/10043.html

Check whether the config file is defined?



Sorry, I didn't understand the TP execution process. I thought it was require '. /ThinkPHP. php '; can be put at will, the original need to define the constant and then require. After this order is adjusted, the above usage will be fine. It's annoying for the moderator.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.