@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @var array [langId => langCode] |
29 | 29 | */ |
30 | - public $sitemapLanguages = []; |
|
30 | + public $sitemapLanguages = [ ]; |
|
31 | 31 | /** |
32 | 32 | * If TRUE - Yii::$app->language will be switched for each sitemapLanguages and restored after. |
33 | 33 | * |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | { |
61 | 61 | return static::find() |
62 | 62 | ->with([ |
63 | - 'productsLanguages' => function ($query) use ($lang) { |
|
63 | + 'productsLanguages' => function($query) use ($lang) { |
|
64 | 64 | /** @var \yii\db\Query $query */ |
65 | 65 | $query->andWhere([ |
66 | 66 | 'language_id' => Language::findOne([ |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function getSitemapLoc($lang = null) |
84 | 84 | { |
85 | - return Url::to('/' . $lang . '/product/' . $this->alias, true); |
|
85 | + return Url::to('/'.$lang.'/product/'.$this->alias, true); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function getSitemapAlternateLinks() |
118 | 118 | { |
119 | - $buffer = []; |
|
119 | + $buffer = [ ]; |
|
120 | 120 | |
121 | 121 | foreach ($this->sitemapLanguages as $langCode) { |
122 | - $buffer[$langCode] = $this->getSitemapLoc($langCode); |
|
122 | + $buffer[ $langCode ] = $this->getSitemapLoc($langCode); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | return $buffer; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | /** |
17 | 17 | * @var array |
18 | 18 | */ |
19 | - public $delete_items = []; |
|
19 | + public $delete_items = [ ]; |
|
20 | 20 | |
21 | 21 | const SCENARIO_DELETE_SELECTED = 'delete_selected'; |
22 | 22 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | Model::scenarios(), |
55 | 55 | parent::scenarios(), |
56 | 56 | [ |
57 | - self::SCENARIO_DELETE_SELECTED => ['delete_items'] |
|
57 | + self::SCENARIO_DELETE_SELECTED => [ 'delete_items' ] |
|
58 | 58 | ] |
59 | 59 | ); |
60 | 60 | } |
@@ -118,6 +118,6 @@ discard block |
||
118 | 118 | */ |
119 | 119 | public function deleteSelected() |
120 | 120 | { |
121 | - return static::deleteAll(['id' => $this->delete_items]); |
|
121 | + return static::deleteAll([ 'id' => $this->delete_items ]); |
|
122 | 122 | } |
123 | 123 | } |
@@ -10,17 +10,17 @@ discard block |
||
10 | 10 | /* @var $this Itstructure\AdminModule\components\AdminView */ |
11 | 11 | |
12 | 12 | $this->title = Yii::t('feedback', 'Feedback'); |
13 | -$this->params['breadcrumbs'][] = $this->title; |
|
13 | +$this->params[ 'breadcrumbs' ][ ] = $this->title; |
|
14 | 14 | ?> |
15 | 15 | <div class="feedback-index"> |
16 | 16 | |
17 | - <?php echo $this->render('_search', ['model' => $searchModel]); ?> |
|
17 | + <?php echo $this->render('_search', [ 'model' => $searchModel ]); ?> |
|
18 | 18 | |
19 | - <?php echo LinkPager::widget(['pagination' => $dataProvider->getPagination()]) ?> |
|
19 | + <?php echo LinkPager::widget([ 'pagination' => $dataProvider->getPagination() ]) ?> |
|
20 | 20 | |
21 | 21 | <?php $form = ActiveForm::begin([ |
22 | 22 | 'action' => [ |
23 | - $this->params['urlPrefix'].'delete-selected' |
|
23 | + $this->params[ 'urlPrefix' ].'delete-selected' |
|
24 | 24 | ], |
25 | 25 | 'method' => 'post', |
26 | 26 | ]); ?> |
@@ -61,12 +61,12 @@ discard block |
||
61 | 61 | ], |
62 | 62 | [ |
63 | 63 | 'attribute' => 'created_at', |
64 | - 'format' => ['date', 'dd.MM.Y HH:mm:ss'], |
|
64 | + 'format' => [ 'date', 'dd.MM.Y HH:mm:ss' ], |
|
65 | 65 | 'label' => Yii::t('app', 'Created date'), |
66 | 66 | ], |
67 | 67 | [ |
68 | 68 | 'attribute' => 'updated_at', |
69 | - 'format' => ['date', 'dd.MM.Y HH:mm:ss'], |
|
69 | + 'format' => [ 'date', 'dd.MM.Y HH:mm:ss' ], |
|
70 | 70 | 'label' => Yii::t('app', 'Updated date'), |
71 | 71 | ], |
72 | 72 | 'read' => [ |
@@ -74,8 +74,7 @@ discard block |
||
74 | 74 | 'value' => function($searchModel) { |
75 | 75 | /* @var $searchModel FeedbackSearch */ |
76 | 76 | return $searchModel->read === 1 ? |
77 | - '<i class="fa fa-check-circle text-success"> ' . Yii::t('feedback', 'Read') . '</i>' : |
|
78 | - '<i class="text-danger">' . Yii::t('feedback', 'New') . '</i>'; |
|
77 | + '<i class="fa fa-check-circle text-success"> '.Yii::t('feedback', 'Read').'</i>' : '<i class="text-danger">'.Yii::t('feedback', 'New').'</i>'; |
|
79 | 78 | }, |
80 | 79 | 'format' => 'raw', |
81 | 80 | ], |
@@ -83,9 +82,9 @@ discard block |
||
83 | 82 | 'class' => 'yii\grid\ActionColumn', |
84 | 83 | 'header' => Yii::t('app', 'Actions'), |
85 | 84 | 'template' => '{view} {delete}', |
86 | - 'urlCreator'=>function($action, $model, $key, $index){ |
|
85 | + 'urlCreator'=>function($action, $model, $key, $index) { |
|
87 | 86 | return Url::to([ |
88 | - $this->params['urlPrefix'].$action, |
|
87 | + $this->params[ 'urlPrefix' ].$action, |
|
89 | 88 | 'id' => $model->id |
90 | 89 | ]); |
91 | 90 | } |
@@ -95,8 +94,8 @@ discard block |
||
95 | 94 | 'header' => Yii::t('app', 'Delete'), |
96 | 95 | 'multiple' => true, |
97 | 96 | 'name' => Html::getInputName($searchModel, 'delete_items'), |
98 | - 'checkboxOptions' => function ($searchModel, $key, $index, $column) use ($form) { |
|
99 | - return ['form' => $form->id, 'value' => $searchModel->id]; |
|
97 | + 'checkboxOptions' => function($searchModel, $key, $index, $column) use ($form) { |
|
98 | + return [ 'form' => $form->id, 'value' => $searchModel->id ]; |
|
100 | 99 | } |
101 | 100 | ], |
102 | 101 | ], |
@@ -104,7 +103,7 @@ discard block |
||
104 | 103 | |
105 | 104 | <?php if ($dataProvider->count > 0): ?> |
106 | 105 | <div class="form-group"> |
107 | - <?php echo Html::submitButton(Yii::t('app', 'Delete selected'), ['class' => 'btn btn-primary']) ?> |
|
106 | + <?php echo Html::submitButton(Yii::t('app', 'Delete selected'), [ 'class' => 'btn btn-primary' ]) ?> |
|
108 | 107 | </div> |
109 | 108 | <?php endif; ?> |
110 | 109 |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | 'home' => HomeController::class, |
61 | 61 | 'sitemap' => SitemapController::class |
62 | 62 | ], |
63 | - 'accessRoles' => ['admin', 'manager'], |
|
63 | + 'accessRoles' => [ 'admin', 'manager' ], |
|
64 | 64 | 'components' => [ |
65 | - 'view' => require __DIR__ . '/view-component.php', |
|
66 | - 'multilanguage-validate-component' => require __DIR__ .'/multilanguage-validate-component.php', |
|
65 | + 'view' => require __DIR__.'/view-component.php', |
|
66 | + 'multilanguage-validate-component' => require __DIR__.'/multilanguage-validate-component.php', |
|
67 | 67 | ], |
68 | 68 | 'isMultilanguage' => true, |
69 | 69 | ], |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | 'permissions' => PermissionController::class, |
76 | 76 | 'profiles' => ProfileController::class |
77 | 77 | ], |
78 | - 'accessRoles' => ['admin', 'manager'], |
|
78 | + 'accessRoles' => [ 'admin', 'manager' ], |
|
79 | 79 | 'components' => [ |
80 | - 'view' => require __DIR__ . '/view-component.php', |
|
80 | + 'view' => require __DIR__.'/view-component.php', |
|
81 | 81 | ], |
82 | 82 | ], |
83 | 83 | 'mfuploader' => [ |
@@ -94,14 +94,14 @@ discard block |
||
94 | 94 | 'text-album' => TextAlbumController::class, |
95 | 95 | 'other-album' => OtherAlbumController::class, |
96 | 96 | ], |
97 | - 'accessRoles' => ['admin', 'manager'], |
|
97 | + 'accessRoles' => [ 'admin', 'manager' ], |
|
98 | 98 | 'defaultStorageType' => MFUModule::STORAGE_TYPE_LOCAL, |
99 | - 'previewOptions' => require __DIR__ . '/../preview-options.php', |
|
99 | + 'previewOptions' => require __DIR__.'/../preview-options.php', |
|
100 | 100 | 'components' => [ |
101 | 101 | 'local-upload-component' => [ |
102 | 102 | 'class' => LocalUploadComponent::class, |
103 | 103 | 'checkExtensionByMimeType' => false, |
104 | - 'uploadRoot' => dirname($_SERVER['SCRIPT_FILENAME']) |
|
104 | + 'uploadRoot' => dirname($_SERVER[ 'SCRIPT_FILENAME' ]) |
|
105 | 105 | ], |
106 | 106 | /*'s3-upload-component' => [ |
107 | 107 | 'class' => S3UploadComponent::class, |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | 'region' => 'us-west-2', |
111 | 111 | 's3DefaultBucket' => 'filesmodule2', |
112 | 112 | ],*/ |
113 | - 'view' => require __DIR__ . '/view-component.php', |
|
113 | + 'view' => require __DIR__.'/view-component.php', |
|
114 | 114 | ], |
115 | - 'publicBaseUrl' => $webConfig['homeUrl'] |
|
115 | + 'publicBaseUrl' => $webConfig[ 'homeUrl' ] |
|
116 | 116 | ] |
117 | 117 | ], |
118 | 118 | 'components' => [ |
@@ -3,14 +3,14 @@ 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'; |
|
8 | -$baseUrl = require __DIR__ . '/base-url.php'; |
|
6 | +$params = require __DIR__.'/params.php'; |
|
7 | +$db = require __DIR__.'/db.php'; |
|
8 | +$baseUrl = require __DIR__.'/base-url.php'; |
|
9 | 9 | |
10 | 10 | $config = [ |
11 | 11 | 'id' => 'yii2-template-multilanguage-console', |
12 | 12 | 'basePath' => dirname(__DIR__), |
13 | - 'bootstrap' => ['log'], |
|
13 | + 'bootstrap' => [ 'log' ], |
|
14 | 14 | 'controllerNamespace' => 'app\commands', |
15 | 15 | 'aliases' => [ |
16 | 16 | '@bower' => '@vendor/bower-asset', |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | 'targets' => [ |
33 | 33 | [ |
34 | 34 | 'class' => 'yii\log\FileTarget', |
35 | - 'levels' => ['error', 'warning'], |
|
35 | + 'levels' => [ 'error', 'warning' ], |
|
36 | 36 | ], |
37 | 37 | ], |
38 | 38 | ], |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | |
65 | 65 | if (YII_ENV_DEV) { |
66 | 66 | // configuration adjustments for 'dev' environment |
67 | - $config['bootstrap'][] = 'gii'; |
|
68 | - $config['modules']['gii'] = [ |
|
67 | + $config[ 'bootstrap' ][ ] = 'gii'; |
|
68 | + $config[ 'modules' ][ 'gii' ] = [ |
|
69 | 69 | 'class' => 'yii\gii\Module', |
70 | 70 | ]; |
71 | 71 | } |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$params = require __DIR__ . '/params.php'; |
|
4 | -$db = require __DIR__ . '/db.php'; |
|
5 | -$translations = require __DIR__ . '/translations.php'; |
|
6 | -$baseUrl = require __DIR__ . '/base-url.php'; |
|
3 | +$params = require __DIR__.'/params.php'; |
|
4 | +$db = require __DIR__.'/db.php'; |
|
5 | +$translations = require __DIR__.'/translations.php'; |
|
6 | +$baseUrl = require __DIR__.'/base-url.php'; |
|
7 | 7 | |
8 | 8 | $config = [ |
9 | 9 | 'id' => 'yii2_template_multilanguage', |
10 | 10 | 'version' => '1.0.0', |
11 | 11 | 'basePath' => dirname(__DIR__), |
12 | 12 | 'homeUrl' => $baseUrl, |
13 | - 'bootstrap' => ['log'], |
|
13 | + 'bootstrap' => [ 'log' ], |
|
14 | 14 | 'language' => 'en-US', |
15 | 15 | 'aliases' => [ |
16 | 16 | '@bower' => '@vendor/bower-asset', |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | 'targets' => [ |
53 | 53 | [ |
54 | 54 | 'class' => 'yii\log\FileTarget', |
55 | - 'levels' => ['error', 'warning'], |
|
55 | + 'levels' => [ 'error', 'warning' ], |
|
56 | 56 | ], |
57 | 57 | ], |
58 | 58 | ], |
@@ -102,18 +102,18 @@ discard block |
||
102 | 102 | |
103 | 103 | if (YII_ENV_DEV) { |
104 | 104 | // configuration adjustments for 'dev' environment |
105 | - $config['bootstrap'][] = 'debug'; |
|
106 | - $config['modules']['debug'] = [ |
|
105 | + $config[ 'bootstrap' ][ ] = 'debug'; |
|
106 | + $config[ 'modules' ][ 'debug' ] = [ |
|
107 | 107 | 'class' => 'yii\debug\Module', |
108 | 108 | // uncomment the following to add your IP if you are not connecting from localhost. |
109 | - 'allowedIPs' => ['127.0.0.1', '::1', '*'], |
|
109 | + 'allowedIPs' => [ '127.0.0.1', '::1', '*' ], |
|
110 | 110 | ]; |
111 | 111 | |
112 | - $config['bootstrap'][] = 'gii'; |
|
113 | - $config['modules']['gii'] = [ |
|
112 | + $config[ 'bootstrap' ][ ] = 'gii'; |
|
113 | + $config[ 'modules' ][ 'gii' ] = [ |
|
114 | 114 | 'class' => 'yii\gii\Module', |
115 | 115 | // uncomment the following to add your IP if you are not connecting from localhost. |
116 | - 'allowedIPs' => ['127.0.0.1', '::1', '*'], |
|
116 | + 'allowedIPs' => [ '127.0.0.1', '::1', '*' ], |
|
117 | 117 | ]; |
118 | 118 | } |
119 | 119 |
@@ -5,23 +5,23 @@ |
||
5 | 5 | use Itstructure\RbacModule\Module as RbacModule; |
6 | 6 | use Itstructure\MFUploader\Module as MFUModule; |
7 | 7 | |
8 | -if (file_exists(__DIR__ . '/../config/environment.php')) { |
|
9 | - require __DIR__ . '/../config/environment.php'; |
|
8 | +if (file_exists(__DIR__.'/../config/environment.php')) { |
|
9 | + require __DIR__.'/../config/environment.php'; |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | defined('YII_DEBUG') or define('YII_DEBUG', false); |
13 | 13 | defined('YII_ENV') or define('YII_ENV', 'prod'); |
14 | 14 | |
15 | -require __DIR__ . '/../vendor/autoload.php'; |
|
16 | -require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php'; |
|
15 | +require __DIR__.'/../vendor/autoload.php'; |
|
16 | +require __DIR__.'/../vendor/yiisoft/yii2/Yii.php'; |
|
17 | 17 | |
18 | 18 | Yii::setAlias('@app', dirname(__DIR__)); |
19 | 19 | Yii::setAlias('@admin', AdminModule::getBaseDir()); |
20 | 20 | Yii::setAlias('@rbac', RbacModule::getBaseDir()); |
21 | 21 | Yii::setAlias('@mfuploader', MFUModule::getBaseDir()); |
22 | 22 | |
23 | -$webConfig = require __DIR__ . '/../config/web.php'; |
|
24 | -$adminConfig = require __DIR__ . '/../config/admin/admin.php'; |
|
23 | +$webConfig = require __DIR__.'/../config/web.php'; |
|
24 | +$adminConfig = require __DIR__.'/../config/admin/admin.php'; |
|
25 | 25 | |
26 | 26 | $config = ArrayHelper::merge($webConfig, $adminConfig); |
27 | 27 |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @var array [langId => langCode] |
29 | 29 | */ |
30 | - public $sitemapLanguages = []; |
|
30 | + public $sitemapLanguages = [ ]; |
|
31 | 31 | /** |
32 | 32 | * If TRUE - Yii::$app->language will be switched for each sitemapLanguages and restored after. |
33 | 33 | * |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | { |
61 | 61 | return static::find() |
62 | 62 | ->with([ |
63 | - 'categoriesLanguages' => function ($query) use ($lang) { |
|
63 | + 'categoriesLanguages' => function($query) use ($lang) { |
|
64 | 64 | /** @var \yii\db\Query $query */ |
65 | 65 | $query->andWhere([ |
66 | 66 | 'language_id' => Language::findOne([ |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | ->where([ |
73 | 73 | 'active' => 1 |
74 | 74 | ])->andWhere([ |
75 | - 'NOT', ['alias' => null] |
|
75 | + 'NOT', [ 'alias' => null ] |
|
76 | 76 | ])->andWhere([ |
77 | - 'NOT', ['alias' => ''] |
|
77 | + 'NOT', [ 'alias' => '' ] |
|
78 | 78 | ])->orderBy([ |
79 | 79 | 'id' => SORT_DESC |
80 | 80 | ]); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function getSitemapLoc($lang = null) |
87 | 87 | { |
88 | - return Url::to('/' . $lang . '/category/' . $this->alias, true); |
|
88 | + return Url::to('/'.$lang.'/category/'.$this->alias, true); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -119,10 +119,10 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function getSitemapAlternateLinks() |
121 | 121 | { |
122 | - $buffer = []; |
|
122 | + $buffer = [ ]; |
|
123 | 123 | |
124 | 124 | foreach ($this->sitemapLanguages as $langCode) { |
125 | - $buffer[$langCode] = $this->getSitemapLoc($langCode); |
|
125 | + $buffer[ $langCode ] = $this->getSitemapLoc($langCode); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | return $buffer; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @var array [langId => langCode] |
29 | 29 | */ |
30 | - public $sitemapLanguages = []; |
|
30 | + public $sitemapLanguages = [ ]; |
|
31 | 31 | /** |
32 | 32 | * If TRUE - Yii::$app->language will be switched for each sitemapLanguages and restored after. |
33 | 33 | * |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | { |
61 | 61 | return static::find() |
62 | 62 | ->with([ |
63 | - 'articlesLanguages' => function ($query) use ($lang) { |
|
63 | + 'articlesLanguages' => function($query) use ($lang) { |
|
64 | 64 | /** @var \yii\db\Query $query */ |
65 | 65 | $query->andWhere([ |
66 | 66 | 'language_id' => Language::findOne([ |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function getSitemapLoc($lang = null) |
84 | 84 | { |
85 | - return Url::to('/' . $lang . '/article/' . $this->alias, true); |
|
85 | + return Url::to('/'.$lang.'/article/'.$this->alias, true); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function getSitemapAlternateLinks() |
118 | 118 | { |
119 | - $buffer = []; |
|
119 | + $buffer = [ ]; |
|
120 | 120 | |
121 | 121 | foreach ($this->sitemapLanguages as $langCode) { |
122 | - $buffer[$langCode] = $this->getSitemapLoc($langCode); |
|
122 | + $buffer[ $langCode ] = $this->getSitemapLoc($langCode); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | return $buffer; |