zoukankan      html  css  js  c++  java
  • 自动生成admin(后台)

    public --->>>>index.php

    入口文件如下:

     1 // +----------------------------------------------------------------------
     2 // | ThinkPHP [ WE CAN DO IT JUST THINK ]
     3 // +----------------------------------------------------------------------
     4 // | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
     5 // +----------------------------------------------------------------------
     6 // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
     7 // +----------------------------------------------------------------------
     8 // | Author: liu21st <liu21st@gmail.com>
     9 // +----------------------------------------------------------------------
    10 
    11 // [ 应用入口文件 ]
    12   use 	hinkBuild;
    13 // 定义应用目录
    14 define('APP_PATH', __DIR__ . '/../application/');
    15 // 加载框架引导文件
    16 require __DIR__ . '/../thinkphp/start.php';
    17 $build = include '../build.php';
    18 Build::run($build);

     在application同级的目录下找到build.php文件

    内容如下:

     1 <?php
     2 // +----------------------------------------------------------------------
     3 // | ThinkPHP [ WE CAN DO IT JUST THINK ]
     4 // +----------------------------------------------------------------------
     5 // | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
     6 // +----------------------------------------------------------------------
     7 // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
     8 // +----------------------------------------------------------------------
     9 // | Author: liu21st <liu21st@gmail.com>
    10 // +----------------------------------------------------------------------
    11 
    12 return [
    13     // 生成应用公共文件,显示在application/index下
    14     '__file__' => ['common.php', 'config.php', 'database.php'],
    15 
    16     // 定义admin模块的自动生成 (按照实际定义的文件名生成)
    17     'admin'     => [
    18         '__file__'   => ['common.php'],
    19         '__dir__'    => ['behavior', 'controller', 'model', 'view'],
    20         'controller' => ['Index', 'Test', 'UserType'],
    21         'model'      => ['User', 'UserType'],
    22         'view'       => ['index/index'],
    23     ],
    24     // 其他更多的模块定义
    25 ];
  • 相关阅读:
    [HNOI2016]序列
    [Cqoi2015] 编号 【逆向思维,暴力枚举】
    [NOI2015] 软件包管理器【树链剖分+线段树区间覆盖】
    [Hdu-6053] TrickGCD[容斥,前缀和]
    [Hdu-5155] Harry And Magic Box[思维题+容斥,计数Dp]
    牛客NOIP暑期七天营-提高组6
    [SHOI2007] 书柜的尺寸 思维题+Dp+空间优化
    [UVA12235] Help Bubu 思维题+状态定义+Dp
    牛客NOIP暑期七天营-TG3 赛后题解
    牛客NOIP暑期七天营-TG1 赛后题解
  • 原文地址:https://www.cnblogs.com/StinkyKids/p/6688800.html
Copyright © 2011-2022 走看看