Added Controller::goHome().
This commit is contained in:
parent
3aaf24a55a
commit
19a872c422
@ -31,7 +31,7 @@ class SiteController extends Controller
|
|||||||
{
|
{
|
||||||
$model = new LoginForm();
|
$model = new LoginForm();
|
||||||
if ($model->load($_POST) && $model->login()) {
|
if ($model->load($_POST) && $model->login()) {
|
||||||
return $this->redirect(array('site/index'));
|
return $this->goHome();
|
||||||
} else {
|
} else {
|
||||||
return $this->render('login', array(
|
return $this->render('login', array(
|
||||||
'model' => $model,
|
'model' => $model,
|
||||||
@ -42,7 +42,7 @@ class SiteController extends Controller
|
|||||||
public function actionLogout()
|
public function actionLogout()
|
||||||
{
|
{
|
||||||
Yii::$app->user->logout();
|
Yii::$app->user->logout();
|
||||||
return $this->redirect(array('site/index'));
|
return $this->goHome();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionContact()
|
public function actionContact()
|
||||||
|
@ -37,7 +37,8 @@ app\config\AppAsset::register($this);
|
|||||||
Yii::$app->user->isGuest ?
|
Yii::$app->user->isGuest ?
|
||||||
array('label' => 'Login', 'url' => array('/site/login')) :
|
array('label' => 'Login', 'url' => array('/site/login')) :
|
||||||
array('label' => 'Logout (' . Yii::$app->user->identity->username .')' , 'url' => array('/site/logout')),
|
array('label' => 'Logout (' . Yii::$app->user->identity->username .')' , 'url' => array('/site/logout')),
|
||||||
)));
|
),
|
||||||
|
));
|
||||||
NavBar::end();
|
NavBar::end();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user