The meaning of the framework
Reduce repetitive labor
Facilitates team collaboration
Enhanced security
Work / interview is required
Why Study thinkphp
Domestic companies use a lot of
The framework is basically an MVC architecture that learns a
I. Deployment of the framework
1.1 Download TP official website
http://www.thinkphp.cn/
1.2 Introduction
A: unzip file
B: get thinkphp directory ( As long as this can )
C:thinkphp can be placed in any directory ( not necessarily www "
D: Build the project shop, CMS, Blog etc
E: project directory , create index.php
index.php content is as follows
// define the application directory define('app_path','./'); // Introducing the thinkphp entry file ' .. /thinkphp/thinkphp.php';
1.3 Build Project
After the configuration of the 1.2 is completed ,
automatically generate projects when you run index.php at addresses
See the following interface , the configuration is successful
Welcome to use thinkphp!
after success , The following directories are automatically generated
Common// Library , classes and so on can be here
Home//controll Model View It's all here.
Runtime// run-time generated files
1.4 Creating a Module
what is a module : 1 a website , Common front Desk , admin Backstage , Both functions , CSS, pictures, etc. , It's a big difference. .
Development Time , for clarity , can be divided into 2 a module to manage .
Copy directly Home Module
and rename it to Admin
Modify Admin/controller/indexcontroller the namespace
PHP namespace Home\controller; modified to php namespace Admin\controller;
<? phpnamespace Admin\controller; Use Think\controller; class extends Controller { publicfunction index () { echo ' Admin '; }}
Address bar Access /index.php/admin/index/index
Represents the module creation success!
Preliminary understanding of thinkphp