1 | <?php |
||
21 | class SortAction extends Action |
||
22 | { |
||
23 | /** |
||
24 | * Sorting model class name |
||
25 | * @var string |
||
26 | */ |
||
27 | public $modelClass; |
||
28 | |||
29 | /** |
||
30 | * Redirect URL if request not by ajax |
||
31 | * @var array |
||
32 | */ |
||
33 | public $redirectUrl = ['index']; |
||
34 | |||
35 | /** |
||
36 | * Sort action |
||
37 | * @param int $id model identifier |
||
38 | * @param int|string $position new sort position |
||
39 | * May be set as: |
||
40 | * top - move model to top of sorting |
||
41 | * bottom - move model to bottom of sorting |
||
42 | * u<number> - up to <number> positions |
||
43 | * d<number> - down to <number> positions |
||
44 | * -<number> - down to <number> positions |
||
45 | * <number> - move tto specific position |
||
46 | * @return array|Response |
||
47 | * @throws HttpException |
||
48 | */ |
||
49 | public function run($id, $position) |
||
87 | } |
||
88 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: