@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | use app\models\{About, Technology, Quality, User, Home}; |
3 | 3 | use Itstructure\MFUploader\Module as MFUModule; |
4 | 4 | |
5 | -$contacts = $this->params['contacts']; |
|
5 | +$contacts = $this->params[ 'contacts' ]; |
|
6 | 6 | |
7 | 7 | /* @var $about About */ |
8 | 8 | /* @var $team User[] */ |
@@ -13,18 +13,18 @@ discard block |
||
13 | 13 | window.sent_message = '<?php echo Yii::t('feedback', 'You have successfully sent your message.'); ?>'; |
14 | 14 | window.need_captcha = '<?php echo Yii::t('feedback', 'Let us know that you are not a robot. Click on pictures above.'); ?>'; |
15 | 15 | window.error_captcha = '<?php echo Yii::t('feedback', 'Error verify captcha.'); ?>'; |
16 | - window.short_language = '<?php echo $this->params['shortLanguage']; ?>'; |
|
16 | + window.short_language = '<?php echo $this->params[ 'shortLanguage' ]; ?>'; |
|
17 | 17 | </script> |
18 | 18 | |
19 | -<?php if (!empty($model->{'content_'.$this->params['shortLanguage']})): ?> |
|
19 | +<?php if (!empty($model->{'content_'.$this->params[ 'shortLanguage' ]})): ?> |
|
20 | 20 | <section class="inform_block"> |
21 | 21 | |
22 | 22 | <div class="container"> |
23 | 23 | |
24 | 24 | <div class="row" data-animated="fadeIn"> |
25 | 25 | <div class="col-lg-12 col-md-12 col-sm-10"> |
26 | - <h1 class="text-center"><?php echo $model->{'title_'.$this->params['shortLanguage']}; ?></h1> |
|
27 | - <?php echo $model->{'content_'.$this->params['shortLanguage']} ?> |
|
26 | + <h1 class="text-center"><?php echo $model->{'title_'.$this->params[ 'shortLanguage' ]}; ?></h1> |
|
27 | + <?php echo $model->{'content_'.$this->params[ 'shortLanguage' ]} ?> |
|
28 | 28 | </div> |
29 | 29 | </div> |
30 | 30 | </div> |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | <?php $timeStart = 0.1; ?> |
42 | 42 | <?php $timeEnd = 0.5; ?> |
43 | 43 | <?php $count = count($about->qualities); ?> |
44 | - <?php $timeStep = $count > 1 ? ($timeEnd-$timeStart)/($count-1) : 0; ?> |
|
44 | + <?php $timeStep = $count > 1 ? ($timeEnd - $timeStart)/($count - 1) : 0; ?> |
|
45 | 45 | <?php $time = $timeStart; ?> |
46 | 46 | <?php foreach ($about->qualities as $quality): ?> |
47 | 47 | <?php /* @var Quality $quality */ ?> |
48 | 48 | <div class="col-lg-4 col-md-4 col-sm-4 wow fadeInUp" data-wow-delay="<?php echo $time; ?>s"> |
49 | 49 | <i class="<?php echo $quality->icon ?>"></i> |
50 | - <h3><?php echo $quality->{'title_'.$this->params['shortLanguage']}; ?></h3> |
|
51 | - <?php echo $quality->{'description_'.$this->params['shortLanguage']}; ?> |
|
50 | + <h3><?php echo $quality->{'title_'.$this->params[ 'shortLanguage' ]}; ?></h3> |
|
51 | + <?php echo $quality->{'description_'.$this->params[ 'shortLanguage' ]}; ?> |
|
52 | 52 | </div> |
53 | 53 | <?php $time += $timeStep; ?> |
54 | 54 | <?php endforeach; ?> |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | |
58 | 58 | <hr> |
59 | 59 | <div class="col-md-6 col-sm-6 wow fadeInUp" data-wow-delay="0.3s"> |
60 | - <h2 class="text-center"><?php echo $about->{'title_'.$this->params['shortLanguage']}; ?></h2> |
|
61 | - <?php echo $about->{'description_'.$this->params['shortLanguage']}; ?> |
|
60 | + <h2 class="text-center"><?php echo $about->{'title_'.$this->params[ 'shortLanguage' ]}; ?></h2> |
|
61 | + <?php echo $about->{'description_'.$this->params[ 'shortLanguage' ]}; ?> |
|
62 | 62 | </div> |
63 | 63 | <?php if (is_array($about->technologies)): ?> |
64 | 64 | <div class="col-md-6 col-sm-6 wow fadeInUp" data-wow-delay="0.5s"> |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | <?php $timeStart = 0.1; ?> |
98 | 98 | <?php $timeEnd = 0.5; ?> |
99 | 99 | <?php $count = count($team); ?> |
100 | - <?php $timeStep = $count > 1 ? ($timeEnd-$timeStart)/($count-1) : 0; ?> |
|
100 | + <?php $timeStep = $count > 1 ? ($timeEnd - $timeStart)/($count - 1) : 0; ?> |
|
101 | 101 | <?php $time = $timeStart; ?> |
102 | 102 | <?php foreach ($team as $user): ?> |
103 | 103 | <?php /* @var User $user */ ?> |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | <div class="team-des"> |
114 | 114 | <div class="team-name"><?php echo $user->getFullName() ?></div> |
115 | 115 | <?php if (!empty($user->position)): ?> |
116 | - <div class="team-position"><?php echo $user->position->{'name_'.$this->params['shortLanguage']}; ?></div> |
|
116 | + <div class="team-position"><?php echo $user->position->{'name_'.$this->params[ 'shortLanguage' ]}; ?></div> |
|
117 | 117 | <?php endif; ?> |
118 | 118 | </div> |
119 | 119 | </div> |
@@ -131,26 +131,26 @@ discard block |
||
131 | 131 | <div class="container"> |
132 | 132 | <div class="row"> |
133 | 133 | <div class="col-md-12 col-sm-12 text-center"> |
134 | - <h2><?php echo $contacts->{'title_'.$this->params['shortLanguage']} ?></h2> |
|
134 | + <h2><?php echo $contacts->{'title_'.$this->params[ 'shortLanguage' ]} ?></h2> |
|
135 | 135 | </div> |
136 | 136 | </div> |
137 | 137 | <div class="row"> |
138 | - <?php if (!empty($contacts->{'phone_'.$this->params['shortLanguage']})): ?> |
|
138 | + <?php if (!empty($contacts->{'phone_'.$this->params[ 'shortLanguage' ]})): ?> |
|
139 | 139 | <div class="contact-info-box col-md-4 col-sm-4 col-xs-6 wow fadeInUp" data-wow-delay="0.1s"> |
140 | 140 | <i class="fa fa-phone"></i> |
141 | - <h3><?php echo $contacts->{'phone_'.$this->params['shortLanguage']} ?></h3> |
|
141 | + <h3><?php echo $contacts->{'phone_'.$this->params[ 'shortLanguage' ]} ?></h3> |
|
142 | 142 | </div> |
143 | 143 | <?php endif; ?> |
144 | - <?php if (!empty($contacts->{'email_'.$this->params['shortLanguage']})): ?> |
|
144 | + <?php if (!empty($contacts->{'email_'.$this->params[ 'shortLanguage' ]})): ?> |
|
145 | 145 | <div class="contact-info-box col-md-4 col-sm-4 col-xs-6 wow fadeInUp" data-wow-delay="0.3s"> |
146 | 146 | <i class="fa fa-envelope-o"></i> |
147 | - <h3><a href="mailto:<?php echo $contacts->{'email_'.$this->params['shortLanguage']} ?>"><?php echo $contacts->{'email_'.$this->params['shortLanguage']} ?></a></h3> |
|
147 | + <h3><a href="mailto:<?php echo $contacts->{'email_'.$this->params[ 'shortLanguage' ]} ?>"><?php echo $contacts->{'email_'.$this->params[ 'shortLanguage' ]} ?></a></h3> |
|
148 | 148 | </div> |
149 | 149 | <?php endif; ?> |
150 | - <?php if (!empty($contacts->{'address_'.$this->params['shortLanguage']})): ?> |
|
150 | + <?php if (!empty($contacts->{'address_'.$this->params[ 'shortLanguage' ]})): ?> |
|
151 | 151 | <div class="contact-info-box col-md-4 col-sm-4 col-xs-6 wow fadeInUp" data-wow-delay="0.5s"> |
152 | 152 | <i class="fa fa-map-marker"></i> |
153 | - <h3><?php echo $contacts->{'address_'.$this->params['shortLanguage']} ?></h3> |
|
153 | + <h3><?php echo $contacts->{'address_'.$this->params[ 'shortLanguage' ]} ?></h3> |
|
154 | 154 | </div> |
155 | 155 | <?php endif; ?> |
156 | 156 | </div> |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | </div> |
180 | 180 | <div class="col-md-12 col-sm-12 fl-block j-cn a-c"> |
181 | 181 | <div class="g-recaptcha" id="google-recaptcha-feedback" |
182 | - data-sitekey="<?php echo Yii::$app->params['captcha']['site_key'];?>" |
|
182 | + data-sitekey="<?php echo Yii::$app->params[ 'captcha' ][ 'site_key' ]; ?>" |
|
183 | 183 | data-callback="validateRecaptchaFeedback" |
184 | 184 | data-expired-callback="grecaptcha_reset" |
185 | 185 | ></div> |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | |
18 | 18 | if (!isset($frameworkPath)) { |
19 | 19 | $searchPaths = [ |
20 | - dirname(__FILE__) . '/vendor/yiisoft/yii2', |
|
21 | - dirname(__FILE__) . '/../vendor/yiisoft/yii2', |
|
20 | + dirname(__FILE__).'/vendor/yiisoft/yii2', |
|
21 | + dirname(__FILE__).'/../vendor/yiisoft/yii2', |
|
22 | 22 | ]; |
23 | - foreach($searchPaths as $path) { |
|
23 | + foreach ($searchPaths as $path) { |
|
24 | 24 | if (is_dir($path)) { |
25 | 25 | $frameworkPath = $path; |
26 | 26 | break; |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | if (!isset($frameworkPath) || !is_dir($frameworkPath)) { |
32 | 32 | $message = "<h1>Error</h1>\n\n" |
33 | 33 | . "<p><strong>The path to yii framework seems to be incorrect.</strong></p>\n" |
34 | - . '<p>You need to install Yii framework via composer or adjust the framework path in file <abbr title="' . __FILE__ . '">' . basename(__FILE__) . "</abbr>.</p>\n" |
|
35 | - . '<p>Please refer to the <abbr title="' . dirname(__FILE__) . "/README.md\">README</abbr> on how to install Yii.</p>\n"; |
|
34 | + . '<p>You need to install Yii framework via composer or adjust the framework path in file <abbr title="'.__FILE__.'">'.basename(__FILE__)."</abbr>.</p>\n" |
|
35 | + . '<p>Please refer to the <abbr title="'.dirname(__FILE__)."/README.md\">README</abbr> on how to install Yii.</p>\n"; |
|
36 | 36 | |
37 | - if (!empty($_SERVER['argv'])) { |
|
37 | + if (!empty($_SERVER[ 'argv' ])) { |
|
38 | 38 | // do not print HTML when used in console mode |
39 | 39 | echo strip_tags($message); |
40 | 40 | } else { |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | exit(1); |
44 | 44 | } |
45 | 45 | |
46 | -require_once($frameworkPath . '/requirements/YiiRequirementChecker.php'); |
|
46 | +require_once($frameworkPath.'/requirements/YiiRequirementChecker.php'); |
|
47 | 47 | $requirementsChecker = new YiiRequirementChecker(); |
48 | 48 | |
49 | 49 | $gdMemo = $imagickMemo = 'Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required for image CAPTCHA.'; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | if (extension_loaded('gd')) { |
63 | 63 | $gdInfo = gd_info(); |
64 | - if (!empty($gdInfo['FreeType Support'])) { |
|
64 | + if (!empty($gdInfo[ 'FreeType Support' ])) { |
|
65 | 65 | $gdOK = true; |
66 | 66 | } else { |
67 | 67 | $gdMemo = 'GD extension should be installed with FreeType support in order to be used for image CAPTCHA.'; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | // OPcache check |
151 | 151 | if (!version_compare(phpversion(), '5.5', '>=')) { |
152 | - $requirements[] = array( |
|
152 | + $requirements[ ] = array( |
|
153 | 153 | 'name' => 'APC extension', |
154 | 154 | 'mandatory' => false, |
155 | 155 | 'condition' => extension_loaded('apc'), |
@@ -4,5 +4,5 @@ |
||
4 | 4 | 'defaultPageSize' => 10, |
5 | 5 | 'adminEmail' => '[email protected]', |
6 | 6 | 'googleApiKey' => 'AIzaSyCoC4gFaWQxlv5MG_OHTJOUmJLA-ib8c78', |
7 | - 'captcha' => require __DIR__ . '/captcha.php' |
|
7 | + 'captcha' => require __DIR__.'/captcha.php' |
|
8 | 8 | ]; |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | use Itstructure\AdminModule\Module as AdminModule; |
4 | 4 | use Itstructure\MFUploader\Module as MFUModule; |
5 | 5 | |
6 | -$params = require __DIR__ . '/params.php'; |
|
7 | -$db = require __DIR__ . '/db.php'; |
|
6 | +$params = require __DIR__.'/params.php'; |
|
7 | +$db = require __DIR__.'/db.php'; |
|
8 | 8 | |
9 | 9 | $config = [ |
10 | 10 | 'id' => 'yii2-template-multilanguage-console', |
11 | 11 | 'basePath' => dirname(__DIR__), |
12 | - 'bootstrap' => ['log'], |
|
12 | + 'bootstrap' => [ 'log' ], |
|
13 | 13 | 'controllerNamespace' => 'app\commands', |
14 | 14 | 'aliases' => [ |
15 | 15 | '@bower' => '@vendor/bower-asset', |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | 'targets' => [ |
32 | 32 | [ |
33 | 33 | 'class' => 'yii\log\FileTarget', |
34 | - 'levels' => ['error', 'warning'], |
|
34 | + 'levels' => [ 'error', 'warning' ], |
|
35 | 35 | ], |
36 | 36 | ], |
37 | 37 | ], |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | |
64 | 64 | if (YII_ENV_DEV) { |
65 | 65 | // configuration adjustments for 'dev' environment |
66 | - $config['bootstrap'][] = 'gii'; |
|
67 | - $config['modules']['gii'] = [ |
|
66 | + $config[ 'bootstrap' ][ ] = 'gii'; |
|
67 | + $config[ 'modules' ][ 'gii' ] = [ |
|
68 | 68 | 'class' => 'yii\gii\Module', |
69 | 69 | ]; |
70 | 70 | } |
@@ -9,5 +9,5 @@ |
||
9 | 9 | //'mainMenuConfig' => require __DIR__ . '/main-menu.php', |
10 | 10 | 'companyName' => 'Yii2 template', |
11 | 11 | 'shotCompanyName' => 'YTM', |
12 | - 'extraAssets' => require __DIR__ . '/extra-assets.php', |
|
12 | + 'extraAssets' => require __DIR__.'/extra-assets.php', |
|
13 | 13 | ]; |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | -$db = require __DIR__ . '/db.php'; |
|
2 | +$db = require __DIR__.'/db.php'; |
|
3 | 3 | // test database! Important not to run tests on production or development databases |
4 | -$db['dsn'] = 'mysql:host=localhost;dbname=yii2_basic_tests'; |
|
4 | +$db[ 'dsn' ] = 'mysql:host=localhost;dbname=yii2_basic_tests'; |
|
5 | 5 | |
6 | 6 | return $db; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -$params = require __DIR__ . '/params.php'; |
|
3 | -$db = require __DIR__ . '/test_db.php'; |
|
2 | +$params = require __DIR__.'/params.php'; |
|
3 | +$db = require __DIR__.'/test_db.php'; |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Application configuration shared by all test types |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | 'useFileTransport' => true, |
20 | 20 | ], |
21 | 21 | 'assetManager' => [ |
22 | - 'basePath' => __DIR__ . '/../web/assets', |
|
22 | + 'basePath' => __DIR__.'/../web/assets', |
|
23 | 23 | ], |
24 | 24 | 'urlManager' => [ |
25 | 25 | 'showScriptName' => true, |
@@ -52,7 +52,7 @@ |
||
52 | 52 | int $statusCode = 200): array { |
53 | 53 | |
54 | 54 | if (null === $data) { |
55 | - $data = (object)[]; |
|
55 | + $data = (object)[ ]; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | \Yii::$app->response->statusCode = $statusCode; |
@@ -34,24 +34,24 @@ |
||
34 | 34 | */ |
35 | 35 | public function beforeAction($action) |
36 | 36 | { |
37 | - $this->view->mainMenuConfig = require __DIR__ . '/../config/admin/main-menu.php'; |
|
37 | + $this->view->mainMenuConfig = require __DIR__.'/../config/admin/main-menu.php'; |
|
38 | 38 | |
39 | - $this->view->homeUrl = '/' . $this->shortLanguage . '/admin'; |
|
39 | + $this->view->homeUrl = '/'.$this->shortLanguage.'/admin'; |
|
40 | 40 | |
41 | - $this->view->signOutLink = '/' . $this->shortLanguage . '/logout'; |
|
41 | + $this->view->signOutLink = '/'.$this->shortLanguage.'/logout'; |
|
42 | 42 | |
43 | - $this->view->profileLink = '/' . $this->shortLanguage . '/admin/users/view?id='.Yii::$app->getUser()->id; |
|
43 | + $this->view->profileLink = '/'.$this->shortLanguage.'/admin/users/view?id='.Yii::$app->getUser()->id; |
|
44 | 44 | |
45 | - Yii::$app->getUser()->loginUrl = '/' . $this->shortLanguage . '/login'; |
|
45 | + Yii::$app->getUser()->loginUrl = '/'.$this->shortLanguage.'/login'; |
|
46 | 46 | |
47 | - $this->urlPrefix = '/' . $this->shortLanguage . '/' . $this->module->id . '/' . $action->controller->id . '/'; |
|
47 | + $this->urlPrefix = '/'.$this->shortLanguage.'/'.$this->module->id.'/'.$action->controller->id.'/'; |
|
48 | 48 | |
49 | 49 | if (array_key_exists($action->controller->id, $this->neighborControllers)) { |
50 | - $this->urlPrefixNeighbor = '/' . $this->shortLanguage . '/' . $this->module->id . '/' . |
|
51 | - $this->neighborControllers[$action->controller->id] . '/'; |
|
50 | + $this->urlPrefixNeighbor = '/'.$this->shortLanguage.'/'.$this->module->id.'/'. |
|
51 | + $this->neighborControllers[ $action->controller->id ].'/'; |
|
52 | 52 | } |
53 | 53 | |
54 | - $this->view->userBody = ArrayHelper::map($this->languages, 'name', function ($item) { |
|
54 | + $this->view->userBody = ArrayHelper::map($this->languages, 'name', function($item) { |
|
55 | 55 | /* @var Language $item */ |
56 | 56 | return BaseHelper::getSwitchLanguageLink($item->getShortName(), Yii::$app->request); |
57 | 57 | }); |