thinkphp controller debugging and the modification of the trace information template replacement variable turned on logging ____php

Source: Internet
Author: User
1, the Controller debugging:
Halt (' xxx ')//display content, terminate program
2, model debugging (is the current database operation class in the execution of the SQL statement)
$US = M ();
$US->find (1);
echo $US->getlastsql ();




Show Page trace Information
' Show_page_trace ' =>true,


Modification of template substitution variables

' Tmpl_parse_string ' => Array (
' __public__ ' => './public ',
' __attachs__ ' => './attachments/content ',
),



' Log_record ' =>true,//turned on logging.
' Log_record_level ' =>array (' Emerg ', ' ALERT ', ' ERR '),



thinkphp Database
Master-slave database "high concurrency, high load"


One
Database deployment mode: 0 Centralized (single server), 1 distributed (Master-slave server)
' Db_deploy_type ' => 0,
Second, the database information synchronization
Three
' Db_host ' => ' localhost ',//server address
Four
' Db_master_num ' => 1,//read/write separated rear server number




Instantiation model


Four methods:
Because when we name the Think_user thinkphp will be according to the case to distinguish whether you are preceded by an _ underline
Think_user_message can M (' user_message ');
1, New model (' User ');
2,


Traditional use of SQL statement methods
$US = M ();
$list = $US->query (' select * from Think_user ');




Cross-trousers operation
Protected $dbName = ' user ';


Curd manipulation
Find (), select (), FindAll ()




Multiple tables
Indicates that to table prefix array form
Table (Array (' Think_us ' => ' a ', ' think_ok ' => ' mm '))
String form
' Think_us a,think_ok mm '


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.