Home >PHP Framework >YII >Where is the yii framework entry file?

Where is the yii framework entry file?

尚
Original
2019-12-31 15:41:523398browse

Where is the yii framework entry file?

The entry file of yii2 is placed under /module/web.

The web directory is the entrance to the web program. The index.php in the web directory is an entrance to the application.

Where is the yii framework entry file?

Where is the yii framework entry file?

## Index.php file content:

<?php
defined(&#39;YII_DEBUG&#39;) or define(&#39;YII_DEBUG&#39;, true);
defined(&#39;YII_ENV&#39;) or define(&#39;YII_ENV&#39;, &#39;dev&#39;);

require(__DIR__ . &#39;/../../vendor/autoload.php&#39;);
require(__DIR__ . &#39;/../../vendor/yiisoft/yii2/Yii.php&#39;);
require(__DIR__ . &#39;/../../common/config/bootstrap.php&#39;);
require(__DIR__ . &#39;/../config/bootstrap.php&#39;);

$config = yii\helpers\ArrayHelper::merge(
    require(__DIR__ . &#39;/../../common/config/main.php&#39;),
    require(__DIR__ . &#39;/../../common/config/main-local.php&#39;),
    require(__DIR__ . &#39;/../config/main.php&#39;),
    require(__DIR__ . &#39;/../config/main-local.php&#39;)
);

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

Recommended learning:

yii framework

The above is the detailed content of Where is the yii framework entry file?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to log out of yiiNext article:How to log out of yii