@@ -49,7 +49,7 @@ |
||
| 49 | 49 | { |
| 50 | 50 | return [ |
| 51 | 51 | [['body'], 'string'], |
| 52 | - [['name',], 'required'], |
|
| 52 | + [['name', ], 'required'], |
|
| 53 | 53 | [['updated_at'], 'safe'], |
| 54 | 54 | ]; |
| 55 | 55 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | return [ |
| 20 | 20 | [['id'], 'integer'], |
| 21 | 21 | [['key', 'name'], 'string', 'max' => 255], |
| 22 | - [['updated_at',], 'safe'], |
|
| 22 | + [['updated_at', ], 'safe'], |
|
| 23 | 23 | ]; |
| 24 | 24 | } |
| 25 | 25 | |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | 'actions' => ['create'], |
| 40 | 40 | 'allow' => true, |
| 41 | 41 | 'roles' => ['@'], |
| 42 | - 'matchCallback' => function () { |
|
| 42 | + 'matchCallback' => function() { |
|
| 43 | 43 | return !Yii::$app->user->can(User::ROLE_ADMIN); |
| 44 | 44 | }, |
| 45 | 45 | ], |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | 'clientOptions' => ['format' => 'yyyy-mm-d'] |
| 35 | 35 | ]), |
| 36 | 36 | 'format' => 'html', |
| 37 | - 'content' => function ($model) { |
|
| 37 | + 'content' => function($model) { |
|
| 38 | 38 | return Yii::$app->formatter->asDatetime($model->created_at); |
| 39 | 39 | }, |
| 40 | 40 | ], |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | 'clientOptions' => ['format' => 'yyyy-mm-d'] |
| 48 | 48 | ]), |
| 49 | 49 | 'format' => 'html', |
| 50 | - 'content' => function ($model) { |
|
| 50 | + 'content' => function($model) { |
|
| 51 | 51 | return Yii::$app->formatter->asDatetime($model->updated_at); |
| 52 | 52 | }, |
| 53 | 53 | ], |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | [ |
| 24 | 24 | 'label' => Yii::t('user', 'Avatar'), |
| 25 | 25 | 'format' => 'raw', |
| 26 | - 'value' => function ($model) { |
|
| 26 | + 'value' => function($model) { |
|
| 27 | 27 | return Html::img($model->avatar, [ |
| 28 | 28 | 'alt' => Yii::t('user', 'Avatar'), |
| 29 | 29 | 'style' => 'width:60px; object-fit:cover;', |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | [ |
| 44 | 44 | 'attribute' => 'status', |
| 45 | 45 | 'headerOptions' => ['width' => '120'], |
| 46 | - 'content' => function ($model) { |
|
| 46 | + 'content' => function($model) { |
|
| 47 | 47 | $label = User::STATUS_ACTIVE === $model->status ? 'success' : 'default'; |
| 48 | 48 | $label = User::STATUS_BLOCKED === $model->status ? 'danger' : $label; |
| 49 | 49 | return "<span class='visible-md-block visible-xs-block |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | 'clientOptions' => ['format' => 'yyyy-mm-d'] |
| 70 | 70 | ]), |
| 71 | 71 | 'format' => 'html', |
| 72 | - 'content' => function ($model) { |
|
| 72 | + 'content' => function($model) { |
|
| 73 | 73 | return Yii::$app->formatter->asDatetime($model->created_at); |
| 74 | 74 | }, |
| 75 | 75 | ], |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | 'clientOptions' => ['format' => 'yyyy-mm-d'] |
| 83 | 83 | ]), |
| 84 | 84 | 'format' => 'html', |
| 85 | - 'content' => function ($model) { |
|
| 85 | + 'content' => function($model) { |
|
| 86 | 86 | return Yii::$app->formatter->asDatetime($model->last_login_at); |
| 87 | 87 | }, |
| 88 | 88 | ], |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | 'class' => yii\grid\DataColumn::className(), |
| 91 | 91 | 'label' => \Yii::t('user', 'Role'), |
| 92 | 92 | 'attribute' => 'authAssignments.item_name', |
| 93 | - 'value' => function ($model) { |
|
| 93 | + 'value' => function($model) { |
|
| 94 | 94 | return $model->getRoleName() ?: 'no role'; |
| 95 | 95 | }, |
| 96 | 96 | ], |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | <h1><?= Html::encode($model->first_name); ?></h1> |
| 18 | 18 | <div class="form-group"> |
| 19 | 19 | <?= Html::img( |
| 20 | - $model->avatar ? : User::DEFAULT_AVATAR_URL, |
|
| 20 | + $model->avatar ?: User::DEFAULT_AVATAR_URL, |
|
| 21 | 21 | ['alt' => 'User avatar', 'width' => 200, 'height' => 200, 'class' => 'avatar-border'] |
| 22 | 22 | ) ?> |
| 23 | 23 | </div> |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | |
| 19 | 19 | <div class="form-group"> |
| 20 | 20 | <?= Html::img( |
| 21 | - $model->avatar ? : User::DEFAULT_AVATAR_URL, |
|
| 21 | + $model->avatar ?: User::DEFAULT_AVATAR_URL, |
|
| 22 | 22 | ['alt' => 'User avatar', 'width' => 200, 'height' => 200, 'class' => 'avatar-border'] |
| 23 | 23 | ) ?> |
| 24 | 24 | </div> |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | 'title', |
| 26 | 26 | [ |
| 27 | 27 | 'attribute' => 'content', |
| 28 | - 'value' => function ($model) {return StringHelper::truncate($model->content, 150);}, |
|
| 28 | + 'value' => function($model) {return StringHelper::truncate($model->content, 150); }, |
|
| 29 | 29 | ], |
| 30 | 30 | 'description', |
| 31 | 31 | [ |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | 'clientOptions' => ['format' => 'yyyy-mm-d'] |
| 38 | 38 | ]), |
| 39 | 39 | 'format' => 'html', |
| 40 | - 'content' => function ($model) { |
|
| 40 | + 'content' => function($model) { |
|
| 41 | 41 | return Yii::$app->formatter->asDatetime($model->updated_at); |
| 42 | 42 | }, |
| 43 | 43 | 'headerOptions' => ['width' => '150'], |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | { |
| 7 | 7 | public function up() |
| 8 | 8 | { |
| 9 | - $this->insert('auth_assignment',[ |
|
| 9 | + $this->insert('auth_assignment', [ |
|
| 10 | 10 | 'item_name' => 'admin', |
| 11 | 11 | 'user_id' => '1', |
| 12 | 12 | ]); |