public function action_upload_pic() { $article = Model_Article::find(Input::get('object_id')); $output = Model_Upload::uploadPicture(); $upload = Model_Upload::find($output['upload_id']); $article->uploads[] = $upload; $article->save(); $data['response'] = json_encode($output); return Response::forge(View::forge('response', $data, false)); }