【发布时间】:2013-06-25 05:24:55
【问题描述】:
我是 Yii 的新手,很抱歉有人帮我解释一下为什么控制器employeeController.php 没有被调用,我检查并设置了许多文件权限等,
这是我的网址http://dxb.softmatics.com:81/erp/index.php/employe/index
Controller : /.........用于板载控制器..../
class employeController extends Controller{
/**
* Declares class-based actions.
*/
public function actions()
{
return array(
'page'=>array(
'class'=>'CViewAction',
),
);
}
/**
* for index page
*/
public function actionIndex()
{
echo 'in index';
exit;
}
}//...end of class
如果还有什么我会告诉你我的代码,比如配置等
【问题讨论】:
-
你遇到了什么错误??
-
控制器通常被称为:
your_application/index.php?r=Employer/index -
Error 404 Unable to resolve the request "employe/index" ,我什至尝试像这样 dxb.softmatics.com:81/erp/index.php?r=Employer/index 这样的 url,通过设置配置,main.php
-
注意:你的控制器文件名是
EmployeeController,而类名是employeeController,为了避免问题,总是使用相同的字母大小写,最好是第一个字母应该是大写的名字。