Blame view

frontend/controllers/SearchController.php 1.73 KB
fbdb1f1c   Yarik   test
1
2
3
  <?php
  namespace frontend\controllers;
  
6dd6c4bf   Administrator   17.02.16
4
  use common\models\Project;
fbdb1f1c   Yarik   test
5
6
7
8
9
10
11
12
13
  use Yii;
  use common\models\LoginForm;
  use frontend\models\PasswordResetRequestForm;
  use frontend\models\ResetPasswordForm;
  use frontend\models\SignupForm;
  use frontend\models\ContactForm;
  use frontend\models\Options;
  use frontend\models\OptionValues;
  use yii\base\InvalidParamException;
6dd6c4bf   Administrator   17.02.16
14
  use yii\data\ActiveDataProvider;
fbdb1f1c   Yarik   test
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
  use yii\web\BadRequestHttpException;
  use yii\web\Controller;
  use yii\filters\VerbFilter;
  use yii\filters\AccessControl;
  use frontend\models\OptionsToValues;
  use yii\validators\EmailValidator;
  use common\models\User;
  use yii\helpers\VarDumper;
  use common\models\Page; 
  use frontend\models\Option;
  use common\models\Social;
  
  
  /**
   * Site controller
   */
  class SearchController extends Controller
  {
      public $defaultAction = 'common';
  
      /**
       * @inheritdoc
       */
      public function actions()
      {
          return [
              'error' => [
                  'class' => 'yii\web\ErrorAction',
              ],
              'captcha' => [
                  'class' => 'yii\captcha\CaptchaAction',
                  'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
              ],
          ];
      }
  
      public function actionProject()
      {
6dd6c4bf   Administrator   17.02.16
53
54
55
56
57
58
59
60
61
62
63
  
          $projects = new ActiveDataProvider([
              'query' =>  Project::find(),
              'pagination' => [
                  'pageSize' => 9,
              ],
          ]);
  
          return $this->render('project',[
              'projects' => $projects
          ]);
fbdb1f1c   Yarik   test
64
65
66
67
68
69
70
71
72
73
74
75
      }
  
      public function actionCompany()
      {
          return $this->render('company');
      }
  
      public function actionPerformer()
      {
          return $this->render('performer');
      }
  
7fc05ac5   Yarik   test
76
77
78
79
80
      public function actionVacancy()
      {
          return $this->render('vacancy');
      }
  
fbdb1f1c   Yarik   test
81
  }