Learn the front end: thinkphp Study notes (2)

Source: Internet
Author: User
Tags constant definition

1. Debug mode

Set the debug Mode section code as follows:

1 <? PHP 2 Define (' App_debug ',TRUE//  Open Debug mode constant definition code 3require '/thinkphp frame directory/ Thinkphp.php ';

Close the debug mode code as follows:

Define (' App_debug ',false);

2. Configuration

1 // project configuration file 2 return Array (3     ' configuration parameters '     4     //  More configuration Parameters 5    // ... 6 );

3. Controller

The code is as follows:

1 class extends Action {//The class name here should match the file name 2      Public function index () {3         Echo ' hello,world! ' ; 4     }5 }

4.URL

There are some additions to the small dots:

(1) m parameter indicates module, a operation indicates operation

(2) Under PathInfo mode, the URL is customizable

1 // change the pathinfo parameter delimiter

The following URL access is supported:

http://localhost/app/index.php/module-action-var-value/

(3) Rewrite mode : Add the following code

<ifmodule mod_rewrite.c>%{request_filename}-%{request_filename}-^ (. *) $ index.php/$1 [Qsa,pt,L]</IfModule>

Learn the front end: thinkphp Study notes (2)

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.