Passwords (when setting) usually have some constraints.
9 $ui = $DIC->ui()->factory();
10 $lng = $DIC->language();
11 $renderer = $DIC->ui()->renderer();
13 $data = new \ILIAS\Data\Factory();
14 $validation = new \ILIAS\Validation\Factory(
$data,
$lng);
15 $pw_validation = $validation->password();
19 $pwd_input = $ui->input()->field()->password(
"Password",
"constraints in place.")
20 ->withAdditionalConstraint(
21 $validation->parallel([
22 $pw_validation->hasMinLength(8),
23 $pw_validation->hasLowerChars(),
24 $pw_validation->hasUpperChars(),
25 $pw_validation->hasNumbers(),
26 $pw_validation->hasSpecialChars()
30 $pwd_input2 = $ui->input()->field()->password(
"Password",
"constraints in place.")
31 ->withStandardConstraints(8,
true,
true,
true,
true);
34 $DIC->ctrl()->setParameterByClass(
35 'ilsystemstyledocumentationgui',
39 $form_action = $DIC->ctrl()->getFormActionByClass(
'ilsystemstyledocumentationgui');
40 $form = $ui->input()->container()->form()->standard($form_action, [
'pwd' => $pwd_input,
'pwd2' => $pwd_input2]);
45 &&
$request->getQueryParams()[
'example'] ==
'password') {
52 $renderer->render(
$form);
foreach($paths as $path) $request
if(isset($_POST['submit'])) $form