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.
26 lines
666 B
26 lines
666 B
<?php
|
|
namespace Wiggins\MyProject\Example;
|
|
require __DIR__.'/../vendor/autoload.php';
|
|
require __DIR__.'/../vendor/yiisoft/yii2/Yii.php';
|
|
use Wiggins\MyProject\UserInput;
|
|
|
|
|
|
$model=new UserInput(['scenario'=>'register']);
|
|
|
|
$inputDate=[
|
|
"UserInput"=>[
|
|
"name" => "kuangweiian",
|
|
"email" => "12345678@qq.com",
|
|
"password" => "1234567890",
|
|
"pwdConfirm"=> "1234567890",
|
|
]
|
|
];
|
|
$model->load($inputDate);
|
|
|
|
if($model->validate()){
|
|
echo "register succ".PHP_EOL;
|
|
}else{
|
|
echo "register failed".PHP_EOL;
|
|
print_r($model->getErrors());
|
|
}
|
|
?>
|