zoukankan      html  css  js  c++  java
  • tp5.0 新增模块

    其实非常简单,不过开发文档没有细说

    修改public/index.php文件如下:

    // 定义应用目录
    define('APP_PATH', __DIR__ . '/../application/');
    // 加载框架引导文件
    require __DIR__ . '/../thinkphp/start.php';
    
    
    	hinkBuild::module('admin');

    修改build.php文件如下:

    return [
        // 生成应用公共文件
        '__file__' => ['common.php', 'config.php', 'database.php'],
    
        // 定义demo模块的自动生成 (按照实际定义的文件名生成)
        'index'     => [
            '__file__'   => ['common.php'],
            '__dir__'    => ['behavior', 'controller', 'model', 'view'],
            'controller' => ['Index', 'Test', 'UserType'],
            'model'      => ['User', 'UserType'],
            'view'       => ['index/index'],
        ],
        'admin'     => [
            '__file__'   => ['common.php'],
            '__dir__'    => ['behavior', 'controller', 'model', 'view'],
            'controller' => ['Index', 'Test', 'UserType'],
            'model'      => ['User', 'UserType'],
            'view'       => ['index/index'],
        ],
        // 其他更多的模块定义
    ];

    保存以上配置,然后运行首页 即可生成 新的  admin 模块

  • 相关阅读:
    生成8位随机字符串
    Python字符串反转
    dd备份文件系统
    多线程mtr-代码
    Sysctl命令及linux内核参数调整
    解决系统存在大量TIME_WAIT状态的连接
    tcpkill清除异常tcp连接
    graphite
    sed 中带变量的情况
    JAVA的Random类
  • 原文地址:https://www.cnblogs.com/ailingfei/p/9558298.html
Copyright © 2011-2022 走看看