PHP is included in the file for variable sharing issues

Source: Internet
Author: User
Self - PHPIn the process encountered some problems, may be the problem will have common sense errors, please forgive me! Thank you!
Title, there are the following test cases
a.php


  
   

b.php


  
   

But in this case, there will be a warning in Zend Studio Undefined variable '$msg' , although not affecting the results of the operation, but for post-maintenance or other people's reading will have an impact, so I would like to ask what is the best way to solve this "obsessive-compulsive disorder" problem? Can you let Zend Studio not report this warning?

See the typecho source process to see the following statement, located in
/usr/themes/default/404.php


  
   
  
   need('header.php'); ?>                        

404 -

need('footer.php'); ?>

How does that typecho make use $this need of access?
I have noticed that the typecho theme template is used $this to use the provided plug-in or function, and what is the principle?

Reply content:

The PHP process of self-study encountered some problems, there may be common sense errors, please forgive me! Thank you!
Title, there are the following test cases
a.php


  
   

b.php


  
   

But in this case, there will be a warning in Zend Studio Undefined variable '$msg' , although not affecting the results of the operation, but for post-maintenance or other people's reading will have an impact, so I would like to ask what is the best way to solve this "obsessive-compulsive disorder" problem? Can you let Zend Studio not report this warning?

See the typecho source process to see the following statement, located in
/usr/themes/default/404.php


  
   
  
   need('header.php'); ?>                        

404 -

need('footer.php'); ?>

How does that typecho make use $this need of access?
I have noticed that the typecho theme template is used $this to use the provided plug-in or function, and what is the principle?

    1. Do not use a bare global variable to wrap it into a class.

    2. A template is a method include of an object that has this variable within its scope $this .

  • 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.