Thinkphp Framework Foundation

Source: Internet
Author: User

Mvc:model model Model (data) Layer View View Layer Controller controller Logic layer

M: Operational data (data connection, data access)
V: Provide display template
C: Implementing Business logic

MVC: Conventions are better than configuration

Action: The method that is placed inside the controller


Previously accessed by: Access to specific pages
How MVC accesses: access to operations under the Controller (method), not a specific page

Access:

4 in the way:

  1. HTTP//URL/index.php?m=xx&c=xx&a=xx basic get mode
  2. http :// /index.php/ module / controller / operation method Path mode PathInfo
  3. http : / /module / controller / operation method rewrite Rewrite mode
  4. http// URL /index.php?s=/ module / controller / method Compatibility mode

How the controller is defined

1<?PHP2namespace Home\controller;//Define Namespaces3  UseThink\controller; Use parent class controller 4 classIndexcontrollerextendsController5 {6      Public functionLogin ()//Defining Methods7     {8         $this->display ();//using Templates9     }Ten      One      Public functionShuchu () A     { -         Echo"Educational Administration System"; -     } the      -}

How templates are used:

Template (. html file) to be placed under the view file create a new folder with the same name as the controller

Thinkphp Framework Foundation

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.