【发布时间】:2017-09-26 19:18:22
【问题描述】:
我是 yii 的新手,我正在尝试制作“打招呼”yii2 教程。 我在站点控制器上有这个:
//Code
public function actionSay($message = 'Hello')
{
return $this->render('say', ['message' => $message]);
}
//Code
这在我的 say.php 视图中:
<?php
use yii\helpers\Html;
?>
<?= Html::encode($message) ?>
这是我的项目结构:
project structure
但是,当我尝试访问该站点(配置为 yii.local)以显示 say 操作时,我得到了 404 Not Found。
http://yii.local/index.php?r=site%2Fsay&message=Hello+World
有人对此有任何线索吗?也许我错过了一些文档或步骤?
提前致谢。
【问题讨论】:
-
yii.local 用于后端?前端?
-
前端,应该是后端吧?
-
DocumentRoot C:\Apache24\htdocs\yii2\advanced\backend\web ServerName yii.local 这是我的配置
-
您在 Internet 上有 yii.local 的站点,或者您在 localhost 中? ..
-
我在本地主机
标签: php yii yii2 http-status-code-404 yii2-advanced-app