Learning frontend: thinkPHP Study Notes (1) and thinkphp Study Notes
Now the requirements for the front-end are getting higher and higher. Basically, a front-end staff needs to have a background language, so they chose the popular php. It is difficult for me to learn code by myself.
1. Check the directory structure of thinkphp.
1 ├ ── ThinkPHP. php framework portal file (Note: This file cannot be directly executed. It can only be called in the project portal file) 2 ‑common Framework Public file 3 ‑conf framework configuration file 4 ‑extend framework extension directory 5 ‑lang core Language Pack directory 6 ‑lib core class library directory 7 │ ‑behavior core Behavior Class Library 8 │ javas── Core base class library 9 │ javas── Driver built-in Driver 10 │ javas── Cache built-in Cache Driver 11 │ sampled ── Db built-in database Driver 12 │ ├ -TagLib built-in label driver 13 │ └ ── Template built-in Template engine driver 14 │ ─ ── Template built-in Template engine 15 ── Tpl system Template directory
2. Call the thinkphp entry file index. php
1 <? Php2 require '/ThinkPHP framework directory/ThinkPHP. php'; // call entry file mentioned earlier
3. Run index. php under the folder app. Because thinkphp. php is called, the file directory is automatically generated.
1 rows-index. php project portal file 2 javas── Common project public file directory 3 javas── Conf project configuration directory 4 javas── Lang project language directory 5 javas── Lib project class library directory 6 │ javas── Action class library directory 7 │ Behavior-Behavior class library directory 8 │ component-Model class library directory 9 │ component-Widget class library directory 10 component-Runtime project Runtime directory 11 │ component-Cache template Cache directory 12 │ Alibaba-Data cache directory 13 │ Alibaba-Logs log file directory 14 │ Alibaba-Temp temporary cache directory 15 Alibaba-Tpl Project template directory
4. Move the entry file outside the app directory. modify the code as follows.
1 <? Php2 define ('app _ name', 'app'); // define the project NAME 3 define ('app _ path ','. /app/'); // project directory 4 require'/ThinkPHP framework directory/ThinkPHP. php ';
This is the most basic getting started knowledge. Learning one day will always work!