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' => '
',
- ];
- } 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;
?>