public static function store() { self::check_logged_in(); $params = $_POST; $aihe = new Aihe(self::getAndSetAttributes($params)); $errors = $aihe->errors(); if (count($errors) == 0) { $aihe->save(); Redirect::to('/aihelistaus', array('message' => 'Aihe lisätty!')); } else { Redirect::to('/aihelistaus/uusi', array('errors' => $errors)); } }