嗨,我是 YII 2 框架的新手,
我目前正在学习以下教程http://www.yiiframework.com/wiki/490/creating-a-simple-crud-app-with-yii2-revised-12-20-2013/
一切正常,但是当我在 SiteController.php 中创建一个函数时
IE
public function actionLogin()
{
if (!\Yii::$app->user->isGuest) {
return $this->goHome();
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->goBack();
} else {
return $this->render('login', [
'model' => $model,
]);
}
}
当我从浏览器访问它时,如下所示,
http://localhost/basic/web/site/login/
我越来越
找不到对象!在我的浏览器中,但我可以访问 SiteController.php 索引函数,如下所示http://localhost/basic/web/
不知道我在这里缺少什么,你能告诉我这个问题吗?
提前感谢
编辑:出于调试目的,我在\basic\web\index.php中放置了 die 语句,显然它也没有击中该文件