How to quickly start a ThinkPHP project
The subject of the question is an intern and currently works in a company doing backend maintenance and secondary development.
The company's backend and order system are all developed using ThinkPHP, and there are many things.
I don’t know how to start to figure out the architecture of this system. The database is also quite messy (it is ThinkPHP after all)
Currently, I have written a small script based on PHP’s reflection class, which can count the current modules with one click. All controller methods (including protected methods).
Should I continue to analyze controllers one by one, or should I click on the website and start the analysis from the process?
Or are there other better analysis ideas?
I hope seniors can give me some advice
Reply content:
The subject is an intern and currently works in a company doing backend maintenance and secondary development.
The company's backend and order system are all developed using ThinkPHP, and there are many things.
I don’t know how to start to figure out the architecture of this system. The database is also quite messy (it is ThinkPHP after all)
Currently, I have written a small script based on PHP’s reflection class, which can count the current modules with one click. All controller methods (including protected methods).
Should I continue to analyze controllers one by one, or should I click on the website and start the analysis from the process?
Or are there other better analysis ideas?
I hope seniors can give me some advice
Start by analyzing the file, which businesses are which page controllers mainly use which tables.
It is not necessary to read all the files and all methods at the beginning, and it is impossible to understand them.
I think so, first learn to imitate those simple businesses and tables, that is, simple additions, deletions, modifications and searches.
The next step is to study the encapsulated things, how to call them, what business is handled, and which tables are used.
Look for answers with your needs or questions, otherwise such a beautiful winter afternoon would pass by in a daze while dozing off.
Not all methods in the class are useful.
In addition, clarify your own goals, be familiar with the company's business, or understand the TP framework itself.
Process analysis begins
Enable xdebug
, select the function you want to know, click and follow step by step. It is also best to know what each table and field does. It is less efficient to ask your colleagues to mess around on your own.
No need to analyze, just take a rough look. If there are specific needs, then analyze them. Or if you think something is not implemented well, write your own code to replace it. That’s it
It may be faster to get familiar with it based on the business process. Take a rough look at the code. Then take a look at the process. You don’t need to read it in detail. When you need to use it, dig deeper
It is recommended that the poster divides the process into two parts
1. Understand the basic syntax and usage of the TP framework based on the existing TP version
2. Ask the old employees for some business-related things, such as which module the project is responsible for, and then go through the program according to the business process In this way, when a problem is discovered, it can be quickly located without having to find it all at once
What I want to ask is, are there any documents handed over to you? When taking over a project, it is best to follow the document and execute a rough idea of the implementation idea, and then find the corresponding code analysis and process analysis. Once you are familiar with the system, you will also be familiar with the TP.
1. Familiar with business processes
2. Read through the ThinkPHP manual
1. Familiar with system business processes
2. Familiar with thinkphp
3. Familiar with php
First analyze the project requirements and be proficient in the task process
There is also the question of whether it is a framework. The framework only helps you speed up development. The main body is still php and mysql.
The relationship between the tables has nothing to do with whether it is TP.
Or organize the table structure first

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

CakePHP is an open source MVC framework. It makes developing, deploying and maintaining applications much easier. CakePHP has a number of libraries to reduce the overload of most common tasks.

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an
