diff --git a/common/models/Feedback.php b/common/models/Feedback.php index dbd73a2..4164da6 100755 --- a/common/models/Feedback.php +++ b/common/models/Feedback.php @@ -118,6 +118,9 @@ class Feedback extends ArtboxFeedback { return array_merge( + #родительские правила перетирали мои изменения касательно правила required, + # поэтому я вынес все правила кроме required cюда для того ,чтобы не поломать логику в других местах + #parent::rules(), [ [ @@ -155,7 +158,7 @@ class Feedback extends ArtboxFeedback ], 'required', 'message'=>Yii::t('app','requiredField'), - 'on' => self::SCENARIO_DEFAULT, + 'on' => [self::SCENARIO_DEFAULT], ], [ [ @@ -193,7 +196,7 @@ class Feedback extends ArtboxFeedback [ ['name'], 'match', - 'pattern' => '/^[a-zA-Zа-яА-ЯёЁ\s\-]+$/u', + 'pattern' => '/^[a-zA-Zа-яієїґ\'А-ЯІЄЇҐёЁ\s\-]+$/u', 'message'=> \Yii::t('app', 'wrongName'), 'on'=>[self::SCENARIO_FEEDBACK,self::SCENARIO_DEFAULT] ], diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index fb7fc4e..ded9ab3 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -129,7 +129,7 @@ 12, 42, ]; - + $objects = Objectkb::find() ->with('lang.alias') ->where( @@ -182,8 +182,12 @@ public function actionFeedback() { + Yii::$app->response->format = Response::FORMAT_JSON; - + $test=[2,4,5,2,5]; + $test=json_decode($test); + die($test); + /** * @var Mailer $mailer */ @@ -191,11 +195,11 @@ $settings = Settings::getInstance(); if (empty(Yii::$app->request->post())) { + throw new BadRequestHttpException(); } else { $post = Yii::$app->request->post('Feedback'); - switch ($post[ 'topic' ]) { case Feedback::SCENARIO_FEEDBACK : $model = new Feedback([ 'scenario' => Feedback::SCENARIO_FEEDBACK ]); diff --git a/frontend/views/site/contact.php b/frontend/views/site/contact.php index 4a4eb24..a721b1d 100755 --- a/frontend/views/site/contact.php +++ b/frontend/views/site/contact.php @@ -1,10 +1,10 @@ get('seo'); - + $this->params['h1'] = \Yii::t('app', 'menu-contacts'); $this->params[ 'breadcrumbs' ][] = $this->params['h1']; - + $js = <<< JS window.lat = {$settings->lat}; window.lon = {$settings->lon}; JS; - + $this->registerJs($js, View::POS_END); ?>
= Yii::t('app', 'sect3_21') ?>
-- libgit2 0.21.4