Often need to develop projects with thinkphp, always feel that manually creating a controller, model, view is a tedious thing, need to keep copying and pasting. And when the hierarchy of folders is deep, it can be time-consuming to find files back and forth.
I have always believed: The tool is good, its prerequisite. After drawing on some foreign frameworks such as ExtJS and Yii, I thought of developing a command-line tool to simplify the operation. Based on ThinkPHP3.2 Development ~
Tool: Https://git.oschina.net/jiusem/Tptool
Installation
Unzip the project to the D disk, the resulting directory is D:\tptool, and the path is added to the environment variable.
Use
Open the command line switch to the project folder, and the following command creates a new thinkphp project under the test directory:
D:\test > Tptool Create App
To create a controller:
D:\test > Tptool Create C home/index
The above command will create the IndexController.class.php file under the home module.
To create a model:
D:\test > Tptool Create M home/index
To create an association model:
D:\test > Tptool Create RM home/index
To create a view:
D:\test > Tptool Create v Home/index/index
The home/view/index/index.php file will be created.
Advanced use:
Copyright.txt Store is a note template, you can modify the self;
TpController.class.php is a controller template that can be modified by itself;
TpModel.class.php is a model template that can be modified by itself;
Tprelationmodel. Class.php is an association model template that can be modified by itself;
Tpview.php is a view template that you can modify yourself.
thinkphp command-line tools Tptool2.0 using Tutorials