The php class is automatically loaded! I am a beginner in php. now I have a problem, index. php ----- action (folder) & nbsp; ---- indexAction. class. php (file) ----- model (folder) & nbsp; --- about php class automatic loading!
I am a beginner in php. now I have a problem,
IndexAction. class. php: I want to inherit from indexModel. class. php.
Add the _ autoload () method, and directly implement the indexModel class in extend IndexModel. class. php?
Is there a way for the heroes?
------ Solution --------------------
_ Put autoload in index. php.
------ Solution --------------------
Use include or require.
------ Solution --------------------
No
_ Autoload is used in the running stage, and your requirements occur in the compilation stage.
Now that you need inheritance, tell the elders where they are. Otherwise, where should we inherit?
To access other files, include, require, or namespace is always required.
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.