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.
References $DIC, $form, $request, and $result.
9 $ui = $DIC->ui()->factory();
10 $renderer = $DIC->ui()->renderer();
14 $number_input = $ui->input()->field()
15 ->numeric(
"Some Number",
"Put in a number.")
18 $number_input2 = $number_input->withRequired(
true)->withValue(
'');
21 $form = $ui->input()->container()->form()->standard(
'#', [
22 'n1' => $number_input,
23 'n2' => $number_input2
27 if (
$request->getMethod() ==
"POST") {
36 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
37 $renderer->render(
$form);
foreach($paths as $path) $request
if(isset($_POST['submit'])) $form