yii2高级模板添加新增模块
2015-09-16 00:00
871 查看
例, 增加一个 API 的专用模块,在系统初始化的时候 修改 environments\index.php 文件,如下:
后期也可以增加,命令行情况下重新执行根目录下的 init 文件即可,注意不要重写了配置文件;
return [ 'Development' => [ 'path' => 'dev', 'setWritable' => [ // 设置可写目录 'api/runtime', 'api/web/assets', 'api/controllers', //当前目录设置为可写为 Gii 使用,所以生产环境不需要配置 'api/models', //当前目录设置为可写为 Gii 使用,所以生产环境不需要配置 'backend/controllers', //当前目录设置为可写为 Gii 使用,所以生产环境不需要配置 'backend/models', //当前目录设置为可写为 Gii 使用,所以生产环境不需要配置 'backend/runtime', 'backend/web/assets', 'frontend/controllers', //当前目录设置为可写为 Gii 使用,所以生产环境不需要配置 'frontend/models', //当前目录设置为可写为 Gii 使用,所以生产环境不需要配置 'frontend/runtime', 'frontend/web/assets', ], 'setExecutable' => [ 'yii', 'tests/codeception/bin/yii', ], 'setCookieValidationKey' => [ 'api/config/main-local.php', 'backend/config/main-local.php', 'frontend/config/main-local.php', ], ], 'Production' => [ 'path' => 'prod', 'setWritable' => [ 'api/runtime', 'api/web/assets', 'backend/runtime', 'backend/web/assets', 'frontend/runtime', 'frontend/web/assets', ], 'setExecutable' => [ & 3ff0 nbsp; 'yii', ], 'setCookieValidationKey' => [ 'api/config/main-local.php', 'backend/config/main-local.php', 'frontend/config/main-local.php', ], ], ];
后期也可以增加,命令行情况下重新执行根目录下的 init 文件即可,注意不要重写了配置文件;
相关文章推荐
- FTP使用
- php发送get、post请求的几种方法
- Yii框架relations的使用
- Thinkphp 几个调试配置,常量设置项
- PHP基础------序列化数据
- php 设计经典类验证码
- Class __PHP_Incomplete_Class has no unserializer
- PHP7与Swoole
- PHP基础------文件函数
- 通过FTP命令上传下载
- Window8.1下安装IIS+PHP+Zend Optimizer + MySQL方法
- PHP基础------引用传值
- 36. PHP面向对象
- PHP 基础------递归
- A+B for Input-Output Practice (VIII)
- 条款26:尽可能延后变量定义式的出现时间(Postpone variable definitions as long as possible)
- A+B for Input-Output Practice (IV)
- A+B for Input-Output Practice (I)
- php 在线人数,今日访问量,总访问量统计
- PHP中静态(static)调用非静态方法详解