1 | <?php |
||
12 | class DeleteForm extends FormModel |
||
13 | { |
||
14 | /** |
||
15 | * Constructor injects with DI container. |
||
16 | * |
||
17 | * @param Psr\Container\ContainerInterface $di a service container |
||
18 | */ |
||
19 | public function __construct(ContainerInterface $di) |
||
42 | |||
43 | |||
44 | |||
45 | /** |
||
46 | * Get all items as array suitable for display in select option dropdown. |
||
47 | * |
||
48 | * @return array with key value of all items. |
||
49 | */ |
||
50 | protected function getAllItems() : array |
||
62 | |||
63 | |||
64 | |||
65 | /** |
||
66 | * Callback for submit-button which should return true if it could |
||
67 | * carry out its work and false if something failed. |
||
68 | * |
||
69 | * @return bool true if okey, false if something went wrong. |
||
70 | */ |
||
71 | public function callbackSubmit() : bool |
||
79 | |||
80 | |||
81 | |||
82 | /** |
||
83 | * Callback what to do if the form was successfully submitted, this |
||
84 | * happen when the submit callback method returns true. This method |
||
85 | * can/should be implemented by the subclass for a different behaviour. |
||
86 | */ |
||
87 | public function callbackSuccess() |
||
91 | |||
92 | |||
93 | |||
94 | // /** |
||
95 | // * Callback what to do if the form was unsuccessfully submitted, this |
||
96 | // * happen when the submit callback method returns false or if validation |
||
97 | // * fails. This method can/should be implemented by the subclass for a |
||
98 | // * different behaviour. |
||
99 | // */ |
||
100 | // public function callbackFail() |
||
101 | // { |
||
102 | // $this->di->get("response")->redirectSelf()->send(); |
||
103 | // } |
||
104 | } |
||
105 |