YII 用户提交表单到model
当用户提交表单到model时,
所提交的数据都需要写验证,即便没有也要写一个,在model的函数中:
public function rules() {}
然后利用这样的方法直接把表单赋给model,还是很方便的:
$model->attributes = $_POST['RegisterForm'];