$vn = Model_Stockvn::find($id);
$vn->name = Input::post('name');
$vn->title = Input::post('title');
$vn->brand= Input::post('brand');
$vn->year= Input::post('year');
....
....
$vn = Model_Stockvn::find($id);
foreach ($vn::$_properties as $value) {
($value != 'id') and $vn->$value = Input::post($value);
}
$data = \Input::post(); $model->set($data)->save();
Gonab wrote on Friday 20th of July 2012:thank you for your quick reply. It works great. I got to dig more by myself. I don't have the reflex enough to look at inside the existing code of Fuel.
Tiny trick, if you have a form with for example 10 fields, but only 9 of them are properties of the model, you can use:$data = Input::post(); unset($data['this-is-posted-but-not-a-property']); $model->values($data)->set();
$model->prop1 = Input::post('prop1');
$model->prop2 = Input::post('prop2');
....
It looks like you're new here. If you want to get involved, click one of these buttons!