PHP项目开发框架,基于composer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
644 B

  1. <?php
  2. namespace Wiggins\MyProject\Example;
  3. require __DIR__.'/../vendor/autoload.php';
  4. require __DIR__.'/../vendor/yiisoft/yii2/Yii.php';
  5. use Wiggins\MyProject\UserInput;
  6. $model=new UserInput(['scenario'=>'register']);
  7. $inputDate=[
  8. "name" => "kuangweiian",
  9. "email" => "12345678@qq.com",
  10. "password" => "1234567890",
  11. "pwdConfirm"=> "1234567890",
  12. ];
  13. $model->load(["UserInput"=>$inputDate],"UserInput");
  14. if($model->validate()){
  15. echo "register succ".PHP_EOL;
  16. }else{
  17. echo "register failed".PHP_EOL;
  18. print_r($model->getErrors());
  19. }
  20. ?>