ThinkPHP framework construction

Source: Internet
Author: User
ThinkPHP framework construction

The ThinkPHP framework is built. if you need it, you can refer to it.


Set up the controller environment:

Define ('app _ path', './Application/') automatically creates an Application folder and stores the environment in this folder.

Require './ThinkPHP. php'; run the TP framework

Create a controller:

1. storage location: in the Controller folder

2. naming convention: Controller name + Controller. class. php

3. class name and file name have the same name

4. Use Pascal's name method (big hump)

5. case sensitive,

6. THinkPHP uses UTF-8 encoding by default.

ThinkPHP has four routing methods: 1. normal mode http: // localhost/index. php? M = Group & c = controller & a = Method 2. pathinfo mode http: // localhost/index. php/group/controller/method
3. rewrite mode 4. compatibility mode http: // localhost/index. php? S =/group/controller/method

ThinkPHP template:

1. store it in the view folder.

2. a controller corresponds to a folder, and a method corresponds to a template.


System constant/php-weizijiaocheng-313825.html: current path _ CONTROLLER __: current CONTROLLER path _ MODULE __: current Group path _ ACTIOM __: current method path/index. php/Article is equivalent to _ CONTROLLER _ (but it can only be used in the template. that is, it cannot be used in the php file)











ThinkPHP

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.