public static function update($id) { self::check_logged_in(); $params = $_POST; $attributes = array('id' => $id, 'name' => $params['name']); $project = new Project($attributes); $errors = $project->validateProject(); if (count($errors) == 0) { $project->update(); Redirect::to('/project', array('message' => 'Project edited successfully')); } else { View::make('project/edit.html', array('errors' => $errors, 'attributes' => $attributes)); } }