【发布时间】:2016-04-22 16:25:59
【问题描述】:
我从 Yii2 开始,已经安装了 XAMPP,在 Yii2 项目模板的帮助下创建了一个名为 'yiidemo' 的基本项目。然后通过此 URL http://localhost:8080/yiidemo/web/index.php?r=gii 访问 Gii 以生成示例控制器“问候”,但是当我单击“尝试”链接时,它显示以下错误消息(网址为 http://localhost:8080/yiidemo/web/index.php?r=greeting):
未找到 (#404)
这是控制器\greetingController 的代码:
<?php
namespace app\controllers;
class greetingController extends \yii\web\Controller
{
public function actionIndex()
{
return $this->render('views/index');
}
}
这是views\greeting\index.php 代码:
<?php
/* @var $this yii\web\View */
?>
<h1>greeting/index</h1>
<p>
You may change the content of this page by modifying
the file <code><?= __FILE__; ?></code>.
</p>
任何人都可以建议如何使用 Yii2 hello world 示例。
【问题讨论】: