我需要在保存数据后重定向到另一个我自己的页面。为此,我复制了create.php和_from.php(create_1.php和_from_1.php)。但是当我重定向到它时yii给出错误404
//AssimentController.php
if($this->saveed($data1,$studentid,$modelcrite,$model))
{
Yii::app()->session['model']=$model;
$this->actionCreate_1();
}
public function actionCreate_1()
{
$model=new Assiment;
$modelcrite=new AssimentMarks;
$this->redirect(array('create_1'),
array('model'=>$model,'modelcrite'=>$modelcrite,));
}
//在accessRules()函数中
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view','Create_1'),
'users'=>array('*'),
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('create','update','Create_1'),
'users'=>array($user->isTeacher())
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'actions'=>array('admin','delete','create','Create_1'),
'users'=>array($user->isAdmin())
),
任何人都可以告诉我如何解决这个问题吗?
答案 0 :(得分:1)
该行
public function actionscreate_1()
应该阅读
public function actionCreate_1()