| @@ 68-76 (lines=9) @@ | ||
| 65 | public function callbackSubmit() |
|
| 66 | { |
|
| 67 | $elements = ["accept_mail", "accept_phone", "accept_agreement"]; |
|
| 68 | foreach ($elements as $name) { |
|
| 69 | $this->form->addOutput( |
|
| 70 | "$name is " |
|
| 71 | . ($this->form->checked($name) |
|
| 72 | ? "" |
|
| 73 | : "not ") |
|
| 74 | . "checked</br>" |
|
| 75 | ); |
|
| 76 | } |
|
| 77 | ||
| 78 | // Remember values during resubmit, for sake of the example |
|
| 79 | $this->form->rememberValues(); |
|
| @@ 146-154 (lines=9) @@ | ||
| 143 | $elements = [ |
|
| 144 | "checkbox", |
|
| 145 | ]; |
|
| 146 | foreach ($elements as $name) { |
|
| 147 | $this->form->addOutput( |
|
| 148 | "$name is " |
|
| 149 | . ($this->form->checked($name) |
|
| 150 | ? "" |
|
| 151 | : "not ") |
|
| 152 | . "checked</br>" |
|
| 153 | ); |
|
| 154 | } |
|
| 155 | ||
| 156 | // Select multiple returns an array |
|
| 157 | $elements = [ |
|