1 | <?php |
||
27 | class SubmitButtonWidget extends Widget |
||
28 | { |
||
29 | /** |
||
30 | * @var string The label which should be displayed on button. |
||
31 | */ |
||
32 | public $label; |
||
33 | |||
34 | /** |
||
35 | * @var string The label which should be visible when the button is pushed. for example `... sending`. |
||
36 | */ |
||
37 | public $pushed; |
||
38 | |||
39 | /** |
||
40 | * @var array An array with Options which can be passed to the button, see {{luya\helpers\Html::submitButton}}. |
||
41 | */ |
||
42 | public $options = []; |
||
43 | |||
44 | /** |
||
45 | * @since 1.0.24 First time this was introduced |
||
46 | * |
||
47 | * @var activeForm Define activeForm context to use widget in context and only disable button when validation succeeded |
||
48 | */ |
||
49 | protected $activeForm; |
||
50 | |||
51 | /** |
||
52 | * @since 1.0.24 First time this was introduced |
||
53 | * |
||
54 | * @param $activeForm Set $activeForm and check for type "ActiveForm" |
||
55 | */ |
||
56 | public function setActiveForm(ActiveForm $activeForm) |
||
57 | { |
||
58 | $this->activeForm = $activeForm; |
||
|
|||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @since 1.0.24 First time this was introduced |
||
63 | * |
||
64 | * @return ActiveForm Return $activeForm |
||
65 | */ |
||
66 | public function getActiveForm() |
||
67 | { |
||
68 | return $this->activeForm; |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * {@inheritDoc} |
||
73 | */ |
||
74 | public function init() |
||
82 | |||
83 | /** |
||
84 | * * @since 1.0.24 Added "ActiveForm-Mode" which only disables button when given ActiveForm is validated successful |
||
85 | * |
||
86 | * Add beforeSubmit handler which disables button and replaces button text |
||
87 | * @return string |
||
88 | */ |
||
89 | public function run() |
||
121 | |||
122 | } |
||
123 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..