Go to the source code of this file.
◆ numeric_inputs()
Base example showing how to plug a numeric input into a form.
Definition at line 5 of file numeric_inputs.php.
6{
7
9 $ui =
$DIC->ui()->factory();
10 $renderer =
$DIC->ui()->renderer();
12
13
14 $number_input = $ui->input()->field()
15 ->numeric("Some Number", "Put in a number.")
16 ->withValue(133);
17
18 $number_input2 = $number_input->withRequired(true)->withValue('');
19
20
21 $form = $ui->input()->container()->form()->standard(
'#', [
22 'n1' => $number_input,
23 'n2' => $number_input2
24 ]);
25
26
27 if (
$request->getMethod() ==
"POST") {
30 } else {
32 }
33
34
35 return
36 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
37 $renderer->render(
$form);
38}
foreach($paths as $path) $request
if(isset($_POST['submit'])) $form
References $DIC, $form, $request, and $result.