$model = new LandingForm;
$model->attributes = $_POST['form'];
if($model->validate()){
$info = $model->attributes;
...
}
最后是前端提交表单部分的代码,用的jquery:
复制代码 代码如下:
var info = new Object();
info = { 'form[landing_title]': landing_title,
'form[landing_content]': landing_content,
'form[landing_position]': landing_position,
};
var url = "...";
$.post(url, info, function(rst){
...
});
您可能感兴趣的文章: