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.

21 lines
552 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'=>'login']);
  7. $inputDate=[
  8. "name" => "kuangweijian",
  9. "password" => "123456546",
  10. ];
  11. $model->load(["UserInput"=>$inputDate],"UserInput");
  12. if($model->validate()){
  13. echo "login succ".PHP_EOL;
  14. }else{
  15. echo "login failed".PHP_EOL;
  16. print_r($model->getErrors());
  17. }
  18. ?>