Home> PHP Framework> ThinkPHP> body text

What is the folder organization structure of thinkphp?

PHPz
Release: 2023-04-07 13:47:09
Original
647 people have browsed it

In the process of developing using the ThinkPHP framework, the folder organization structure is very important. Because a good organizational structure can make your code clearer and easier to read and improve development efficiency.

The folder organization structure of the ThinkPHP framework is as follows:

├─ application //应用目录 │ ├─ command //控制台指令 (3.2版本以后新增) │ ├─ common //公共模块目录 │ ├─ config //配置文件目录 │ ├─ controller //控制器目录 │ ├─ model //模型目录 │ ├─ service //服务层目录 (3.2版本以后新增) │ ├─ view //视图目录 │ └─ ... //其他自定义模块目录 ├─ extend //扩展类库目录 ├─ public //公共文件目录 ├─ runtime //运行时目录 ├─ thinkphp //框架核心目录 ├─ vendor //第三方类库目录 ├─ composer.json //Composer配置文件 ├─ think
Copy after login

Among them, theapplicationdirectory is the directory where we mainly work. Below, we introduce the role of each directory in detail:

  1. applicationDirectory

applicationDirectory is our main work directory, which contains all the core logic of our application. This directory contains many subdirectories, such ascommand,common,config,controller,model,service,view, etc.

  1. extendDirectory

extenddirectory is the extended class library directory. We can add some commonly used third-party classes The library is placed in this directory for unified management.

  1. publicDirectory

publicDirectory is the public file directory of our application, such as images, JavaScript files, and Some static pages of the website.

  1. runtimeDirectory

runtimeDirectory is a runtime directory, which contains application log files and cache files wait.

  1. thinkphpDirectory

thinkphpdirectory is the core directory of the framework, including all core codes of the framework.

  1. vendorDirectory

vendordirectory is a third-party library directory, organized according to Composer specifications.

  1. composer.jsonFile

composer.jsonfile is the Composer configuration file, used to specify basic project information , dependencies, etc.

Summary: In the ThinkPHP framework, the folder organization structure is very important. It can help us organize our code and improve development efficiency. Being familiar with the folder organization structure of the framework will be very helpful during the development process.

The above is the detailed content of What is the folder organization structure of thinkphp?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!