function put_user()
{
$user_id = input::put('user_id');
$data = input::put('user'); //it's an array
try {
try {
$user = Model_user::find($user_id);
if (!$user) {
$this->response(NULL,404);
} else {
//attributes are added to the object
foreach ($data as $property=>$value) {
$user->$property = $value;
}
$user->save();
}
} catch (Orm\ValidationFailed $e) {
print_r("validation");
}
} catch (OutOfBoundsException $e) {
print_r("out_of_bounds");
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!