Home >PHP Framework >ThinkPHP >What is the organizational structure of the thinkphp folder?

What is the organizational structure of the thinkphp folder?

WBOY
WBOYforward
2023-06-02 09:47:061468browse

When developing using the ThinkPHP framework, a good folder organization structure is crucial. A good organizational structure can make your code clearer and easier to read, thereby improving 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

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

  1. applicationDirectory

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

  1. extend Directory

##extend directory is the extension class library directory, we can pass Some commonly used third-party libraries are placed in this directory for unified management.

  1. publicDirectory

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

  1. runtimeDirectory

runtime directory is a runtime directory that contains applications Log files, cache files, etc.

  1. thinkphpDirectory

##thinkphp

directory is the core directory of the framework, including all the components of the framework core code.

  1. vendor

    Directory

  2. ##vendor
directory is the third-party library directory, according to Composer Organize according to standards.

    composer.json
  1. File

  2. composer.json
file is the Composer configuration file. Used to specify basic project information, dependencies, etc.

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

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete