美文网首页
TP5目录结构(1)

TP5目录结构(1)

作者: royluck | 来源:发表于2019-04-27 22:41 被阅读0次

application:应用目录
>index 前台相关目录
>> controller 控制器
> > view 试图目录
> > module
>admin 后台后台模块

command.php 命令行工具
comman.php 自定义函数
config.php 应用公共的文件
database.php 数据库相关配置文件
route.php 路由配置文件
tags.php 应用行为扩展定义的文件

extend 扩展类库目录
runtime 项目运行生成的相关文件
public web部署目录
>static 放置静态文件(如css文件、js文件...)
>index.php 项目入口文件
>router.php快速测试文件
vendor 第三方类库文件(!!!想当重要)
thinkphp 核心内库文件
build.php 自动生成定义文件
think 命令行入口文件


// 默认输出类型
'default_return_type' => 'html', // 更改配置文件json....


快速创建控制器:

cd C:\xampp\htdocs\tp5\public
php think make:controller index/Test // 在index模块下创建Test控制器

访问控制器:

index模块/Test控制器/hello方法
localhost:8181/index.php/index/test/hello

虚拟域名配置 ?


自动化部署:
1、复制build.php到appliaction目录下;!!!!
2、根据内容配置模块目录;

    // commom 公共模块 用于其它模块去调用它的模型类
    'common' => [
        '__dir__' => ['model'],
        'model' => ['Category','Admin'],
    ],
    // admin 后台模块
    'admin' => [
        '__dir__' => ['controller','view'],
        'controller' => ['Index'],
        'view' => ['index/index'],
    ],
      // api 模块
    'api' => [
        '__dir__' => ['controller','view'],
        'controller' => ['Index','Image'],
    ],
    'bis' => [
        '__dir__' => ['controller', 'view'],
        'controller' => ['Register','Login'],

    ],

3、根目录下执行:

php think build.php

相关文章

网友评论

      本文标题:TP5目录结构(1)

      本文链接:https://www.haomeiwen.com/subject/kavpgqtx.html