diff --git a/composer.json b/composer.json index dd4fb03..c936c3c 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ }, "autoload": { "psr-4": { - "Wiggins\\MyProject\\": "src/" + "wiggins\\myProject\\": "src/" } }, "minimum-stability": "dev", diff --git a/examples/my-class.php b/examples/my-class.php index dec4ece..61fc10e 100644 --- a/examples/my-class.php +++ b/examples/my-class.php @@ -1,9 +1,9 @@ func().PHP_EOL; diff --git a/examples/user-login.php b/examples/user-login.php index a6f7dd2..f5f884e 100644 --- a/examples/user-login.php +++ b/examples/user-login.php @@ -1,8 +1,8 @@ 'login']); diff --git a/examples/user-register.php b/examples/user-register.php index 82812d7..9238f47 100644 --- a/examples/user-register.php +++ b/examples/user-register.php @@ -1,19 +1,19 @@ 'register']); //输入 $inputDate=[ - "name" => "kuangweiian", + "name" => "kuangweijian", "email" => "12345678@qq.com", "password" => "1234567890", "pwdConfirm"=> "1234567890", ]; - $model->load($inputDate,''); + $model->setAttributes($inputDate); //输出 if($model->validate()){ diff --git a/src/MyClass.php b/src/MyClass.php index cba13ef..b8614de 100644 --- a/src/MyClass.php +++ b/src/MyClass.php @@ -1,5 +1,5 @@ 'password','message'=>'两次密码必须一致'], [['name','email','password','pwdConfirm'],'required','on'=>'register'], [['name','password'],'required','on'=>'login'], - [['name'],'Wiggins\MyProject\MyValidator'], + ['name','wiggins\myProject\validators\MyValidator'], ]; } } diff --git a/src/MyValidator.php b/src/validators/MyValidator.php similarity index 92% rename from src/MyValidator.php rename to src/validators/MyValidator.php index f851d86..22e57bd 100644 --- a/src/MyValidator.php +++ b/src/validators/MyValidator.php @@ -1,5 +1,5 @@