28 lines
590 B
PHP
28 lines
590 B
PHP
<?php
|
|
|
|
namespace kernel\modules\user\models\forms;
|
|
|
|
use kernel\FormModel;
|
|
|
|
class CreateUserForm extends FormModel
|
|
{
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'username' => 'required|min-str-len:5|max-str-len:30',
|
|
'password' => 'required|min-str-len:5|max-str-len:30',
|
|
'email' => 'required|email'
|
|
];
|
|
}
|
|
|
|
public function rulesForUpdate(): array
|
|
{
|
|
return [
|
|
'username' => 'required|min-str-len:5|max-str-len:30',
|
|
'password' => '',
|
|
'email' => 'required|email'
|
|
];
|
|
}
|
|
|
|
} |