| 1 | <?php |
||
| 10 | class Action extends \yii\base\Action |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var string|array URL, which user should be redirected to on success. |
||
| 14 | * This could be a plain string URL, URL array configuration which returns actual URL |
||
| 15 | */ |
||
| 16 | public $returnUrl; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param string $defaultActionId |
||
| 20 | * |
||
| 21 | * @return \yii\web\Response |
||
| 22 | */ |
||
| 23 | public function redirectTo($defaultActionId = 'index') |
||
| 31 | } |
||
| 32 |
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: