| 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 | |||
| 27 | 4 | public function __construct() { |
|
| 30 | |||
| 31 | |||
| 32 | /** |
||
| 33 | * @return $this |
||
| 34 | */ |
||
| 35 | 2 | public function handle(FormData $request) { |
|
| 39 | |||
| 40 | |||
| 41 | /** |
||
| 42 | * @return bool |
||
| 43 | */ |
||
| 44 | 2 | public function isSubmitted() { |
|
| 50 | |||
| 51 | |||
| 52 | /** |
||
| 53 | * @param string $type |
||
| 54 | * @return $this |
||
| 55 | */ |
||
| 56 | 4 | public function setType($type) { |
|
| 68 | |||
| 69 | |||
| 70 | /** |
||
| 71 | * @return string |
||
| 72 | */ |
||
| 73 | 1 | public function render() { |
|
| 80 | |||
| 81 | } |