TP, Controller $ this-> has to call the current controller method and attribute

Source: Internet
Author: User
TP, Controller $ this-& gt; can only call the method and attribute of the current controller. 1: PHPcode & lt ;? PhpclassHelloActionextendsAction {publicfunctionIndex () {$ this-& gt;} TP, Controller $ this-> can only call the method and attribute of the current controller.
1: it was okay yesterday,
PHP code
  
              }        }?>

Normally, the method of the parent class can be prompted. here, only one Index is prompted.
Then I looked at the TP core directory, which has the assign method, that is, it cannot be called.

2: Then I manually $ this-> display without prompting, and then prompt that the template does not exist,

The template does not exist [D:/wamp/www/Tphp/Tpl/Home/Hello/index. tpl]

But there is such a file in this directory.


In addition, my actions are red. phpstorm is used, and no error is found...
Red is not noticed after the prompt...

------ Solution --------------------
But why not?
Who prompts ???
------ Solution --------------------
There may be conflicts!
------ Solution --------------------
I have been developing PHP for several years, but why can't I understand it when I look at it? It seems that I am old.

Discussion

But why not?
Who prompts ???

------ Solution --------------------
Let's take a look at your $ this-> display (); method.
------ Solution --------------------
The runtime file has not been re-compiled.

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.