fbdb1f1c
Yarik
test
|
1
2
3
|
<?php
namespace frontend\controllers;
|
f6ea8941
Administrator
09.02.16
|
4
|
use common\models\Fields;
|
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;
|
f6ea8941
Administrator
09.02.16
|
14
|
use yii\helpers\ArrayHelper;
|
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
53
54
|
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 CompanyController extends Controller
{
public $layout = 'company';
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 actionIndex()
{
|
f6ea8941
Administrator
09.02.16
|
55
|
$this->redirect('site/index');
|
fbdb1f1c
Yarik
test
|
56
57
|
}
|
f6ea8941
Administrator
09.02.16
|
58
|
public function actionCommon($company_id)
|
fbdb1f1c
Yarik
test
|
59
|
{
|
f6ea8941
Administrator
09.02.16
|
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
$company = User::findOne($company_id);
$educations = Fields::getData($company->id,$company->className(),'education');
$phones = Fields::getData($company->id,$company->className(),'phone');
$sites = Fields::getData($company->id,$company->className(),'site');
$soft = implode(', ',ArrayHelper::getColumn(Fields::getData($company->id,$company->className(),'soft'), 'soft'));
return $this->render('common',[
'company' => $company,
'educations' => $educations,
'phones' => $phones,
'sites' => $sites,
'soft' => $soft
]);
|
fbdb1f1c
Yarik
test
|
74
75
|
}
|
f6ea8941
Administrator
09.02.16
|
76
|
public function actionPortfolio($company_id)
|
fbdb1f1c
Yarik
test
|
77
|
{
|
f6ea8941
Administrator
09.02.16
|
78
79
80
81
82
|
$company = User::findOne($company_id);
return $this->render('portfolio',[
'company' => $company
]);
|
fbdb1f1c
Yarik
test
|
83
84
|
}
|
f6ea8941
Administrator
09.02.16
|
85
|
public function actionTeam($company_id)
|
fbdb1f1c
Yarik
test
|
86
|
{
|
f6ea8941
Administrator
09.02.16
|
87
88
89
90
91
|
$company = User::findOne($company_id);
return $this->render('team',[
'company' => $company
]);
|
fbdb1f1c
Yarik
test
|
92
93
|
}
|
f6ea8941
Administrator
09.02.16
|
94
|
public function actionBlogList($company_id)
|
fbdb1f1c
Yarik
test
|
95
|
{
|
f6ea8941
Administrator
09.02.16
|
96
97
98
99
100
|
$company = User::findOne($company_id);
return $this->render('blog-list',[
'company' => $company
]);
|
fbdb1f1c
Yarik
test
|
101
102
|
}
|
f6ea8941
Administrator
09.02.16
|
103
|
public function actionBlogView($company_id, $article_id)
|
fbdb1f1c
Yarik
test
|
104
|
{
|
f6ea8941
Administrator
09.02.16
|
105
106
107
108
109
|
$company = User::findOne($company_id);
return $this->render('blog-view',[
'company' => $company
]);
|
fbdb1f1c
Yarik
test
|
110
111
|
}
|
f6ea8941
Administrator
09.02.16
|
112
|
public function actionReview($company_id)
|
fbdb1f1c
Yarik
test
|
113
|
{
|
f6ea8941
Administrator
09.02.16
|
114
115
116
117
118
|
$company = User::findOne($company_id);
return $this->render('review',[
'company' => $company
]);
|
fbdb1f1c
Yarik
test
|
119
120
|
}
|
f6ea8941
Administrator
09.02.16
|
121
|
public function actionVacancyList($company_id)
|
fbdb1f1c
Yarik
test
|
122
|
{
|
f6ea8941
Administrator
09.02.16
|
123
124
125
126
127
|
$company = User::findOne($company_id);
return $this->render('vacancy-list',[
'company' => $company
]);
|
fbdb1f1c
Yarik
test
|
128
129
|
}
|
f6ea8941
Administrator
09.02.16
|
130
|
public function actionVacancyView($company_id, $vacancy_id)
|
fbdb1f1c
Yarik
test
|
131
|
{
|
f6ea8941
Administrator
09.02.16
|
132
133
134
135
136
|
$company = User::findOne($company_id);
return $this->render('vacancy-view',[
'company' => $company
]);
|
fbdb1f1c
Yarik
test
|
137
138
|
}
|
f6ea8941
Administrator
09.02.16
|
139
|
public function actionGallery($company_id)
|
fbdb1f1c
Yarik
test
|
140
|
{
|
f6ea8941
Administrator
09.02.16
|
141
142
|
$company = User::findOne($company_id);
|
fbdb1f1c
Yarik
test
|
143
|
$this->layout = 'gallery-company';
|
f6ea8941
Administrator
09.02.16
|
144
145
146
|
return $this->render('gallery',[
'company' => $company
]);
|
fbdb1f1c
Yarik
test
|
147
148
|
}
}
|