1 | <?php |
||
29 | class SubmitButtonWidget extends Widget |
||
30 | { |
||
31 | /** |
||
32 | * @var string The label which should be displayed on button. |
||
33 | */ |
||
34 | public $label; |
||
35 | |||
36 | /** |
||
37 | * @var string The label which should be visible when the button is pushed. for example `... sending`. |
||
38 | */ |
||
39 | public $pushed; |
||
40 | |||
41 | /** |
||
42 | * @var array An array with Options which can be passed to the button, see {{luya\helpers\Html::submitButton}}. |
||
43 | */ |
||
44 | public $options = []; |
||
45 | |||
46 | private $_activeForm; |
||
47 | |||
48 | /** |
||
49 | * Setter method for Active Form context. |
||
50 | * |
||
51 | * @param ActiveForm $activeForm Set $activeForm and check for type "ActiveForm" |
||
52 | * @since 1.0.24 |
||
53 | */ |
||
54 | public function setActiveForm(ActiveForm $activeForm) |
||
58 | |||
59 | /** |
||
60 | * Getter method for Active Form context. |
||
61 | * |
||
62 | * @return ActiveForm Return $activeForm |
||
63 | * @since 1.0.24 |
||
64 | */ |
||
65 | public function getActiveForm() |
||
69 | |||
70 | /** |
||
71 | * {@inheritDoc} |
||
72 | */ |
||
73 | public function init() |
||
81 | |||
82 | /** |
||
83 | * Add beforeSubmit handler which disables button and replaces button text |
||
84 | * @return string |
||
85 | * @since 1.0.24 Added "ActiveForm-Mode" which only disables button when given ActiveForm is validated successful |
||
86 | */ |
||
87 | public function run() |
||
116 | |||
117 | } |
||
118 |