当我调用控制器然后显示错误 404 系统无法找到请求的操作“索引”。
它的测试控制器文件
class TestController extends Controller
{
public function actionLogin()
{
$model=new SignupForm();
if(isset($_POST['SignupForm']))
{
// collects user input data
$model->attributes=$_POST['SignupForm'];
// validates user input and redirect to previous page if validated
if($model->validate())
$this->redirect(Yii::app()->user->returnUrl);
}
// displays the login form
$this->render('index',array('model'=>$model));
}
}
它的模型文件
class SignupForm extends CFormModel
{
public $username;
public $password;
public $rememberMe=false;
public function rules()
{
return array(
array('username, password', 'required'),
array('rememberMe', 'boolean'),
array('password', 'authenticate'),
);
}
public function authenticate($attribute,$params)
{
$this->_identity=new UserIdentity($this->username,$this->password);
if(!$this->_identity->authenticate())
$this->addError('password','Incorrect username or password.');
}
}
当我调用控制器然后显示错误 404 系统无法找到请求的操作“索引”所以如何修复此错误