May 30, Sunny. " streamer easy to throw people, red cherry, Green banana ." "
Thinkphp is a fast, compatible, and simple, lightweight, homegrown PHP development framework. This article hands-on quickly build a website small application, easy, chat to stimulate, increase everyone learning PHP framework interest, improve development efficiency.
First, the preparatory work
For most programs apes, the interface design is ugly, or "Take doctrine", online to find a free template for use.
1, download a front-end template, Expanding_portfolio.zip
2, download a background template, Admin-templates.rar
3. Download thinkphp framework file ThinkPHP3.1.3 full version thinkphp_full.zip: thinkphp official website http://www.thinkphp.cn/
4, download PHP Program Integration Package phpstudy (PHP 5.2.17), without configuration can be used, is very convenient. Refer to the Product manual for specific use.
Second, create a front-end application framework
1, in the D:\phpStudyB\WWW directory to create the project Myfirstthinkphp_1 (plainly is a folder).
2, < Span style= "Font-family:comic Sans MS; font-size:18px ">thinkphp_ Full.zip framework file inside thinkphp entire copy to project directory myfirstthinkphp_1 below.
3, build the front-end frame home-- write home.php
<?phpdefine (' Think_path ', './thinkphp/');d efine (' App_path ', './home/');d efine (' app_name ', ' home ');d efine (' App_ DEBUG ', true); Requirethink_path. ' Thinkphp.php ';? >
defining several constant definitions with define indicates:
1. Path to the thinkphp framework
2. Foreground Application Catalog
3. Foreground Application Name
4. Turn on debug mode
5. Contains the thinkphp.php file under the thinkphp framework
At this point, there are two files in the Project catalog myfirstthinkphp_1 :
< Span style= "Font-family:comic Sans MS; font-size:18px "> browser input: http://localhost/ myfirstthinkphp_1/home.php,
< Span style= "font-family:comic Sans ms" > at this time, Project catalog myfirstthinkphp_1 more out one folder home:
Open the home directory with the following content:
The resulting project directory structure is similar to the system directory, and the individual folders have the following meanings:
The main focus is on four folders:
1. Conf Store the project configuration file .
2. LIB (core file!) Model classes and controller classes that store MVC patterns)
3. TPL (store template file, front- end template downloaded here )
4. Runtime (store runtime files, such as cache, database table cache)
The first day with no intention of-thinkphp hand quick splicing website