- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
<?php
$form = new Validator;
$form
->newString(Request::get('nickname'));
->addRules(
new FW\Rules\NotEmpty(),
new FW\Rules\Length(4, 16),
new FW\Rules\RegExp('/^[a-z]+$/i')
);
->newString(Request::get('password'))
->addRules(
new FW\Rules\NotEmpty(),
new FW\Rules\MinLength(3),
new App\Rules\PasswordStrength(40)
);
->newString(Request::get('confirm'))
->addRules(
new FW\Rules\NotEmpty(),
new FW\Rules\Equals(Request::get('password'))
)
->newString(Request::get('email'))
->addRules(
new FW\Rules\NotEmpty(),
new FW\Rules\ValidEmail(Request::get('email'))
);
if ($form->isValid()) {
reg_user(Request::get('nickname'), Request::get('password'), Request::get('email'));
} else {
print_r($form->getErrors());
}