Fixed minor consistency bugs in apps * Added 'return' to goHome() calls in actions * Changed $_POST to Yii::$app->request->post()
This commit is contained in:
parent
2fe23bc740
commit
0eff9fb382
@ -55,11 +55,11 @@ class SiteController extends Controller
|
|||||||
public function actionLogin()
|
public function actionLogin()
|
||||||
{
|
{
|
||||||
if (!\Yii::$app->user->isGuest) {
|
if (!\Yii::$app->user->isGuest) {
|
||||||
$this->goHome();
|
return $this->goHome();
|
||||||
}
|
}
|
||||||
|
|
||||||
$model = new LoginForm();
|
$model = new LoginForm();
|
||||||
if ($model->load($_POST) && $model->login()) {
|
if ($model->load(Yii::$app->request->post()) && $model->login()) {
|
||||||
return $this->goBack();
|
return $this->goBack();
|
||||||
} else {
|
} else {
|
||||||
return $this->render('login', [
|
return $this->render('login', [
|
||||||
@ -77,7 +77,7 @@ class SiteController extends Controller
|
|||||||
public function actionContact()
|
public function actionContact()
|
||||||
{
|
{
|
||||||
$model = new ContactForm;
|
$model = new ContactForm;
|
||||||
if ($model->load($_POST) && $model->contact(Yii::$app->params['adminEmail'])) {
|
if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
|
||||||
Yii::$app->session->setFlash('contactFormSubmitted');
|
Yii::$app->session->setFlash('contactFormSubmitted');
|
||||||
return $this->refresh();
|
return $this->refresh();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user