Early morning posts, ask a basic question

Source: Internet
Author: User
Early morning posts, ask a basic question
There's nothing wrong with maintaining a project,
doitphp Framework for the project
There's a problem, search didn't find the answer.
such as Java C # Delphi and other languages,
If you are inheriting a class, you should introduce the corresponding namespaces, files, and so on.
But in this PHP project,
is directly

Class AccountController extends Controller

How did he find the base class and inherit him?

------to solve the idea----------------------
In general, you must first load the Controller class definition file
But you're using a framework, so the work of loading the base class is done by the framework. You just need to use
------to solve the idea----------------------
Require the underlying file class at the portal file
------to solve the idea----------------------
The framework encapsulates a lot of operations, and your idea is no problem.
------to solve the idea----------------------
Second floor positive solution, even in the import file will be re-processing the class name and file name Association problem, this in the Yiimailler plug-in (including landlord problem, see this plugin code can also be resolved)
------to solve the idea----------------------
This frame is simpler than thinkphp.
doit.class.php----> 281 Line Load Controller class Self::loadfile (Doit_root. ' core/controller.class.php ');
doit.class.php----> 286 line Loads the current controller self::loadfile (Controller_dir. $controller that is routed through the route. '. class.php ');
doit.class.php----> 312 rows executes the current controller default method $_app[$appId] = $appObject, $action ();

------to solve the idea----------------------
Doitphp.php should be to initialize the core file to load.
------to solve the idea----------------------
See what the Portal file loads.
  • 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.