1 | <?php |
||
14 | class UsersController extends \yii\web\Controller |
||
15 | { |
||
16 | use ModelTrait; |
||
17 | |||
18 | 33 | public function behaviors() |
|
19 | { |
||
20 | return [ |
||
21 | 33 | 'verbs' => [ |
|
22 | 'class' => VerbFilter::class, |
||
23 | 'actions' => [ |
||
24 | 'set-active' => ['post'], |
||
25 | 'set-block' => ['post'], |
||
26 | 'delete' => ['post'], |
||
27 | 'operations' => ['post'], |
||
28 | 'photo-upload' => ['post'], |
||
29 | 'autocomplete' => ['post'], |
||
30 | ], |
||
31 | ], |
||
32 | ]; |
||
33 | } |
||
34 | |||
35 | 33 | public function actions() |
|
36 | { |
||
37 | return [ |
||
38 | 33 | 'operations' => [ |
|
39 | 33 | 'class' => 'app\modules\admin\controllers\common\OperationsAction', |
|
40 | 33 | 'modelClass' => 'app\models\User', |
|
41 | 'operations' => [ |
||
42 | 'delete' => [], |
||
43 | 33 | 'set-active' => ['status' => User::STATUS_ACTIVE], |
|
44 | 33 | 'set-block' => ['status' => User::STATUS_BLOCKED] |
|
45 | ] |
||
46 | ], |
||
47 | 'set-active' => [ |
||
48 | 33 | 'class' => 'app\modules\admin\controllers\common\UpdateAttributesAction', |
|
49 | 33 | 'modelClass' => 'app\models\User', |
|
50 | 33 | 'attributes' => ['status' => User::STATUS_ACTIVE], |
|
51 | ], |
||
52 | 'set-block' => [ |
||
53 | 33 | 'class' => 'app\modules\admin\controllers\common\UpdateAttributesAction', |
|
54 | 33 | 'modelClass' => 'app\models\User', |
|
55 | 33 | 'attributes' => ['status' => User::STATUS_BLOCKED], |
|
56 | ], |
||
57 | 'delete' => [ |
||
58 | 'class' => 'app\modules\admin\controllers\common\DeleteAction', |
||
59 | 'modelClass' => 'app\models\User', |
||
60 | ], |
||
61 | 'photo-upload' => [ |
||
62 | 'class' => 'rkit\filemanager\actions\UploadAction', |
||
63 | 'modelClass' => 'app\models\UserProfile', |
||
64 | 'attribute' => 'photo', |
||
65 | 'inputName' => 'file', |
||
66 | ], |
||
67 | ]; |
||
68 | } |
||
69 | |||
70 | 33 | public function actionIndex() |
|
83 | |||
84 | public function actionEdit($id = null) |
||
85 | { |
||
117 | |||
118 | public function actionProfile($id) |
||
140 | |||
141 | public function actionAutocomplete() |
||
161 | |||
162 | private function assignRole($model) |
||
174 | } |
||
175 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: