1 | <?php |
||
16 | class Alert extends Widget |
||
17 | { |
||
18 | //modal type |
||
19 | const TYPE_INFO = 'info'; |
||
20 | const TYPE_ERROR = 'error'; |
||
21 | const TYPE_SUCCESS = 'success'; |
||
22 | const TYPE_WARNING = 'warning'; |
||
23 | const TYPE_QUESTION = 'question'; |
||
24 | //input type |
||
25 | const INPUT_TYPE_TEXT = 'text'; |
||
26 | const INPUT_TYPE_EMAIL = 'email'; |
||
27 | const INPUT_TYPE_PASSWORD = 'password'; |
||
28 | const INPUT_TYPE_NUMBER = 'number'; |
||
29 | const INPUT_TYPE_RANGE = 'range'; |
||
30 | const INPUT_TYPE_TEXTAREA = 'textarea'; |
||
31 | const INPUT_TYPE_SELECT = 'select'; |
||
32 | const INPUT_TYPE_RADIO = 'radio'; |
||
33 | const INPUT_TYPE_CHECKBOX = 'checkbox'; |
||
34 | const INPUT_TYPE_FILE = 'file'; |
||
35 | |||
36 | /** |
||
37 | * All the flash messages stored for the session are displayed and removed from the session |
||
38 | * Defaults to false. |
||
39 | * @var bool |
||
40 | */ |
||
41 | public $useSessionFlash = false; |
||
42 | |||
43 | /** |
||
44 | * @var string alert callback |
||
45 | */ |
||
46 | public $callback = 'function() {}'; |
||
47 | |||
48 | /** |
||
49 | * Initializes the widget |
||
50 | */ |
||
51 | 4 | public function init() |
|
56 | |||
57 | /** |
||
58 | * @return string|void |
||
59 | */ |
||
60 | 3 | public function run() |
|
68 | |||
69 | /** |
||
70 | * Renders alerts from session flash settings. |
||
71 | * @see [[\yii\web\Session::getAllFlashes()]] |
||
72 | */ |
||
73 | 2 | public function renderFlashAlerts() |
|
101 | |||
102 | /** |
||
103 | * Renders manually set alerts |
||
104 | */ |
||
105 | 1 | public function renderAlerts() |
|
109 | |||
110 | /** |
||
111 | * Get widget options |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | 3 | public function getOptions() |
|
129 | |||
130 | /** |
||
131 | * @param array $steps |
||
132 | */ |
||
133 | 1 | protected function registerSwalQueue($steps = []) |
|
139 | |||
140 | /** |
||
141 | * @param string $options |
||
142 | * @param string $callback |
||
143 | */ |
||
144 | 2 | protected function registerSwal($options = '', $callback = '') |
|
150 | |||
151 | /** |
||
152 | * Register Animate Assets |
||
153 | */ |
||
154 | 2 | protected function registerAnimate() |
|
158 | |||
159 | /** |
||
160 | * Register client assets |
||
161 | */ |
||
162 | 4 | protected function registerAssets() |
|
171 | |||
172 | /** |
||
173 | * @return \yii\web\Session |
||
174 | */ |
||
175 | 2 | private function getSession() |
|
179 | } |
||
180 |
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: