A thinkphp template constant problem.

Source: Internet
Author: User
In the manual, by default, template replacement only replaces the special string of the template file, and does not replace the output content in dynamic data. But I printed the php-weizijiaocheng-335038.html template constant in the PHP file. why? I am not very familiar with this principle .. In the {code...} Manual, by default, the template replacement replaces only the special strings in the template file, and does not replace the output content in dynamic data.

But I print/php-weizijiaocheng-335038.html in php file this template constant actually can, why? I am not very familiar with this principle ..


  

Reply content:

In the manual, by default, template replacement only replaces the special string of the template file, and does not replace the output content in dynamic data.

But I print/php-weizijiaocheng-335038.html in php file this template constant actually can, why? I am not very familiar with this principle ..


  

In this way, you can print it. What does it mean?

Here _ self _ is used as a magic constant. You try to print _ public _.

TP does not seem to block the _ self _ magic constant. you can print it.

PHP variables are like two types. one is $, and the other is not $. The value is declared through defined ('_ PHP_FILE _', 'AAA, these two variables are similar.

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.