diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 73ad0c7..8575678 100644 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -1,132 +1,127 @@ [ - 'class' => 'yii\web\ErrorAction', - ], - ]; - } - - /** - * @inheritdoc - */ - public function behaviors() - { - return [ - 'verbs' => [ - 'class' => VerbFilter::className(), - 'actions' => [ - 'feedback' => [ 'post' ], - ], - ], - ]; - } - - /** - * Displays homepage. - * - * @return mixed - */ - public function actionIndex() - { - return $this->render('index'); - } - - /** - * Displays contact page. - * - * @return mixed - */ - public function actionContact() - { - $contact = new Feedback(); - return $this->render( - 'contact', - [ - 'contact' => $contact, - ] - ); - } + namespace frontend\controllers; - /** - * Displays about page. - * - * @return mixed - */ - public function actionAbout() - { - return $this->render('about'); - } + use artbox\core\models\Feedback; + use common\models\Settings; + use Yii; + use yii\web\BadRequestHttpException; + use yii\web\Controller; + use yii\filters\VerbFilter; + use yii\web\Response; /** - * Action to view robots.txt file dinamycli - * - * @return string + * Site controller */ - public function actionRobots() + class SiteController extends Controller { - $response = \Yii::$app->response; /** - * @var Settings $settings + * @inheritdoc */ - $settings = Settings::find() - ->one(); - $temp = tmpfile(); - fwrite($temp, $settings->robots); - $meta = stream_get_meta_data($temp); - $response->format = $response::FORMAT_RAW; - $response->headers->set('Content-Type', 'text/plain'); - return $this->renderFile($meta[ 'uri' ]); - } - - public function actionFeedback() - { - Yii::$app->response->format = Response::FORMAT_JSON; - if (empty(Yii::$app->request->post())) { - throw new BadRequestHttpException(); - } else { - $model = new Feedback(); - if ($model->load(Yii::$app->request->post()) && $model->save()) { - return [ - 'success' => true, - 'message' => 'Success message', - 'alert' => '
+ public function actions() + { + return [ + 'error' => [ + 'class' => 'yii\web\ErrorAction', + ], + ]; + } + + /** + * @inheritdoc + */ + public function behaviors() + { + return [ + 'verbs' => [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'feedback' => [ 'post' ], + ], + ], + ]; + } + + /** + * Displays homepage. + * + * @return mixed + */ + public function actionIndex() + { + return $this->render('index'); + } + + /** + * Displays contact page. + * + * @return mixed + */ + public function actionContact() + { + $contact = new Feedback(); + return $this->render( + 'contact', + [ + 'contact' => $contact, + ] + ); + } + + /** + * Displays about page. + * + * @return mixed + */ + public function actionAbout() + { + return $this->render('about'); + } + + /** + * Action to view robots.txt file dinamycli + * + * @return string + */ + public function actionRobots() + { + $response = \Yii::$app->response; + /** + * @var Settings $settings + */ + $settings = Settings::find() + ->one(); + $temp = tmpfile(); + fwrite($temp, $settings->robots); + $meta = stream_get_meta_data($temp); + $response->format = $response::FORMAT_RAW; + $response->headers->set('Content-Type', 'text/plain'); + return $this->renderFile($meta[ 'uri' ]); + } + + public function actionFeedback() + { + Yii::$app->response->format = Response::FORMAT_JSON; + if (empty( Yii::$app->request->post() )) { + throw new BadRequestHttpException(); + } else { + $model = new Feedback(); + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return [ + 'success' => true, + 'message' => 'Success message', + 'alert' => '

Success

Success text

', - ]; - } else { - return [ - 'success' => false, - 'error' => $model->errors, - ]; + ]; + } else { + return [ + 'success' => false, + 'error' => $model->errors, + ]; + } } } } -} diff --git a/frontend/views/site/about.php b/frontend/views/site/about.php index a089df2..b47ad3a 100644 --- a/frontend/views/site/about.php +++ b/frontend/views/site/about.php @@ -1,9 +1,15 @@ get('seo'); + $this->params[ 'breadcrumbs' ][] = $seo->title; ?>
diff --git a/frontend/views/site/contact.php b/frontend/views/site/contact.php index 9e4a7ad..e7a678b 100644 --- a/frontend/views/site/contact.php +++ b/frontend/views/site/contact.php @@ -15,7 +15,7 @@ MapAsset::register($this); $settings = Settings::getInstance(); - $this->title = 'Contact'; + $this->title = \Yii::t('app', 'Contact'); $this->params[ 'breadcrumbs' ][] = $this->title; $js = <<< JS @@ -27,141 +27,171 @@ JS; ?>
-
- -
- -
-
-
-
-

We are here to help you

-
- -

Are you curious about something? Do you have some kind of problem with our products? As am hastily invited settled at limited civilly fortune me. Really spring in extent an by. Judge but built gay party world. Of so am - he remember although required. Bachelor unpacked be advanced at. Confined in declared marianne is vicinity.

-

Please feel free to contact us, our customer service center is working for you 24/7.

-
-
-
- -
- -
- -
-
-
-
- -
-

Address

-

13/25 New Avenue -
New Heaven, 45Y 73J -
England, Great Britain -

-
- -
- +
-
- -
-
- +
+ +
+
+
+
+

We are here to help you

+
+ +

Are you curious about something? Do you have some kind of problem with our products? As am hastily invited settled at limited civilly fortune me. Really spring in extent an by. Judge but built gay party world. Of so am + he remember although required. Bachelor unpacked be advanced at. Confined in declared marianne is vicinity.

+

Please feel free to contact us, our customer service center is working for you 24/7.

+
+
-

Call center

-

This number is toll free if calling from Great Britain otherwise we advise you to use the electronic form of communication.

-

+33 555 444 333 -

-
- -
- -
- -
-
- +
+
+ +
+
+
+
+ +
+

Address

+

+ street )) { + echo $settings->street; + if (!empty( $settings->house )) { + echo " " . $settings->house; + } + echo Html::tag('br'); + } + if (!empty( $settings->city )) { + echo $settings->city; + if (!empty( $settings->country )) { + echo Html::tag('strong', ", " . $settings->country); + } + } + ?> +

+
+ +
+ + +
+ phone )) { + ?> +
+
+ +
+

Call center

+

This number is toll free if calling from Great Britain otherwise we advise you to use the electronic form of communication .

+

+ phone), 'tel:' . $settings->phone); + ?> +

+
+ + +
+ + email )) { + ?> +
+ +
+
+ +
+

Electronic support

+

Please feel free to write an email to us or to use our electronic ticketing system .

+
    +
  • + email), + 'mailto:' . $settings->email + ); + ?> +
  • +
+
+ +
+
-

Electronic support

-

Please feel free to write an email to us or to use our electronic ticketing system.

- -
- -
-
- - - -
- -
-
-
-

Contact form

-
-
+
-
- 'contact-form', - 'method' => 'POST', - 'action' => '/site/feedback', - ] - ); ?> -
-
- field($contact, 'name') - ->textInput(); ?> -
- -
- field($contact, 'email') - ->textInput(); ?> -
-
- field($contact, 'phone') - ->textInput(); ?> -
-
- field($contact, 'message') - ->textarea( - [ - 'rows' => 3, - ] - ); ?> -
- -
- Send message', - [ - 'class' => 'btn btn-template-main', - ] - ) ?> +
+
+ +
+
+

Contact form

+
+
+ +
+ 'contact-form', + 'method' => 'POST', + 'action' => '/site/feedback', + ] + ); ?> +
+
+ field($contact, 'name') + ->textInput(); ?> +
+ +
+ field($contact, 'email') + ->textInput(); ?> +
+
+ field($contact, 'phone') + ->textInput(); ?> +
+
+ field($contact, 'message') + ->textarea( + [ + 'rows' => 3, + ] + ); ?> +
+ +
+ Send message', + [ + 'class' => 'btn btn-template-main', + ] + ) ?> + +
+
+ + +
-
- - -
-
- + + + + - - - -
- + + -- libgit2 0.21.4