diff --git a/common/config/mail.php b/common/config/mail.php index 0c56300..b5ffe15 100755 --- a/common/config/mail.php +++ b/common/config/mail.php @@ -2,9 +2,9 @@ return [ 1 => [ - 'host' => '', - 'user' => '', - 'pass' => '', + 'host' => 'smtp.gmail.com', + 'user' => 'kennen.md@gmail.com', + 'pass' => 'nobeernoparty', 'id' => 1, ], ]; \ No newline at end of file diff --git a/common/config/settings.php b/common/config/settings.php old mode 100644 new mode 100755 index c564301..5224395 --- a/common/config/settings.php +++ b/common/config/settings.php @@ -5,7 +5,7 @@ return [ 'phone' => '+38 (044) 593-73-76', 'phone2' => '+38 (098) 468-07-64', 'skype' => 'artwebstudio', - 'email' => '', + 'email' => 'kennen.md@gmail.com', 'house' => '1-М', 'street' => 'пр. М. Бажана', 'office' => '25', diff --git a/common/models/Order.php b/common/models/Order.php index 32e58ad..14fe7a2 100644 --- a/common/models/Order.php +++ b/common/models/Order.php @@ -20,6 +20,8 @@ use artbox\core\models\Feedback; */ class Order extends Feedback { + const SCENARIO_ORDER = 'order'; + public function rules() { return array_merge(parent::rules(), [ @@ -32,6 +34,14 @@ class Order extends Feedback public function scenarios() { - return []; + return + [ + self::SCENARIO_ORDER => [ + 'name', + 'email', + 'message', + 'subject', + ], + ]; } } diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 9abe702..515c84d 100644 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -113,7 +113,7 @@ if (empty( Yii::$app->request->post() )) { throw new BadRequestHttpException(); } else { - $model = new Order(); + $model = new Order(['scenario' => Order::SCENARIO_ORDER]); if ($model->load(Yii::$app->request->post()) && $model->save()) { try { -- libgit2 0.21.4