【发布时间】:2011-05-11 18:00:03
【问题描述】:
我正在尝试在 Codeigniter 的 Datamapper 中保存一个长表单。如果我传递这样的值,我可以保存表单
$t->brandName = $this->input->post('brandName');
$t->specialNotes = $this->input->post('specialNotes');
$t->name = $this->input->post('name');
现在如果我调用 save 方法就可以了
$t->save();
由于表单很大,我尝试在 foreach 中添加对象值
$a = get_object_vars($t);
foreach ($a['stored'] as $k => $val){
$t->$k = $this->input->post("$k");
}
但是,如果我打电话给$t->save(),它就不起作用了。
【问题讨论】:
标签: php codeigniter orm codeigniter-datamapper