Yii-User Login

I have the yii-user already… the updated one.

My problem is i do not know how to change my index page into my login page.

Note: IN yii-user login page which under the module.

Site Controller code:




public $defaultAction = 'Login';


public function actionLogin()

	{

		if (Yii::app()->user->isGuest) {

			$model=new UserLogin;

			// collect user input data

			if(isset($_POST['UserLogin']))

			{

				$model->attributes=$_POST['UserLogin'];

				// validate user input and redirect to previous page if valid

				if($model->validate()) {

					$this->lastVisit();

					if (Yii::app()->getBaseUrl()."/index.php" === Yii::app()->user->returnUrl)

						$this->redirect(Yii::app()->controller->module->returnUrl);

					else

						$this->redirect(Yii::app()->user->returnUrl);

				}

			}

			// display the login form

			$this->render('/user/login',array('model'=>$model));

		} else

			$this->redirect(Yii::app()->controller->module->returnUrl);

	}



And the browser display this error: SiteController cannot find the requested view "/user/login".

Thanks… :unsure:

Here your view file(login form ) is render form the file user/login.php (Means user folder and login.php file)




 	$this->render('/user/login',array('model'=>$model));



so please ensure '/user/login.php exist.

Note: Most of the time controllerName/file.php is used to render the view

the view file is under user/views/user/login

thats the problem

u may simply copy the login.php to the views/site

and use like




 $this->render('login',array('model'=>$model));