php - redirecting pages in yii afterlogin -
this sitecontroller.php im trying redirect user after login static website shows simple hello. i'm having trouble redirecting my aindex.php
public function actionlogin() { $model=new loginform; yii::app()->session['username'] = 'seslog'; if(isset($_post['ajax']) && $_post['ajax']==='login-form') { echo cactiveform::validate($model); yii::app()->end(); } if(isset($_post['loginform'])) { $model->attributes=$_post['loginform']; if($model->validate() && $model->login()){ $this->redirect(array('site/aindex'));//i can't redirect } } $this->render('login',array('model'=>$model)); }
here aindex.php file
<?php echo "hello "; ?>
you using 'array' value sending specific url, not array.
http://book.cakephp.org/2.0/en/controllers.html
just use :- $this->redirect('site/aindex');
Comments
Post a Comment