如何为多个项目配置Yii2基本模板

时间:2017-12-05 13:30:32

标签: php apache yii2

我是使用PHP和Yii2的新手。

我在 Apache 目录中使用 Composer 安装了 Yii2基本模板框架 'var / www / html'它在localhost中正常工作。

为了避免为我开始的每个新项目下载Yii2框架,我想为所有项目加载和重用Yii2,而不是一直修改它。

所以,我需要弄清楚如何在基本的文件夹中加载Yii2,如下所示:

var/www/html
|-- basic
    |--assets
    |--commands
    |--config
    |--controllers
    ...
    ...
|--myNewApplication
...
... LOAD OR POINT to **basic** here!

basic / web 中的 index.php 文件:

<?php

// comment out the following two lines when deployed to production
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

require(__DIR__ . '/../vendor/autoload.php');
require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');

$config = require(__DIR__ . '/../config/web.php');

(new yii\web\Application($config))->run();

如果有人可以帮我,请!

感谢!!!

0 个答案:

没有答案