thinkphp command-line tools Tptool2.0 using Tutorials

Source: Internet
Author: User

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

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.