| 1 | <?php |
||
| 7 | class Button extends BaseElement { |
||
| 8 | |||
| 9 | /** |
||
| 10 | * just a button |
||
| 11 | */ |
||
| 12 | const TYPE_BUTTON = 'button'; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * reset value from each element in form |
||
| 16 | */ |
||
| 17 | const TYPE_RESET = 'reset'; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * submit form |
||
| 21 | */ |
||
| 22 | const TYPE_SUBMIT = 'submit'; |
||
| 23 | |||
| 24 | protected $isSubmitted = false; |
||
| 25 | |||
| 26 | protected $attributes = [ |
||
| 27 | 4 | 'type' => self::TYPE_BUTTON, |
|
| 28 | 4 | ]; |
|
| 29 | 4 | ||
| 30 | |||
| 31 | /** |
||
| 32 | * @return $this |
||
| 33 | */ |
||
| 34 | public function handle(FormData $request) { |
||
| 38 | |||
| 39 | |||
| 40 | /** |
||
| 41 | * @return bool |
||
| 42 | */ |
||
| 43 | public function isSubmitted() { |
||
| 49 | |||
| 50 | |||
| 51 | /** |
||
| 52 | * @param string $type |
||
| 53 | * @return $this |
||
| 54 | */ |
||
| 55 | public function setType($type) { |
||
| 67 | |||
| 68 | |||
| 69 | /** |
||
| 70 | * @return string |
||
| 71 | */ |
||
| 72 | public function render() { |
||
| 79 | |||
| 80 | } |