ecf49b1b
Administrator
second
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<?php
namespace frontend\controllers;
use Yii;
use yii\web\Controller;
use common\models\Subscribe;
use yii\web\HttpException;
use yii\data\Pagination;
class SubscribeController extends Controller
{
public function actionIndex()
{
$model = new Subscribe;
if ($model->load(Yii::$app->request->post()) && $model->save()) {
Yii::$app->getSession()->setFlash('success', 'Вы успешно подписались на рассылку!');
return $this->refresh();
}
return $this->render('index',['model'=>$model]);
}
}
|