public static function store()
 {
     $params = $_POST;
     $attributes = self::setAndGetAttributes($params);
     $kayttaja = new Kayttaja($attributes);
     $errors = $kayttaja->errors();
     if (count($errors) == 0) {
         $kayttaja->save();
         Redirect::to('/login', array('message' => 'Käyttäjätiedot tallennettu, voit nyt kirjautua sisään!'));
     } else {
         $ryhmat = Ryhma::all();
         View::make('kayttaja/uusi.html', array('errors' => $errors, 'attributes' => $attributes, 'ryhmat' => $ryhmat));
     }
 }
 public static function index()
 {
     self::check_logged_in();
     $ryhmat = Ryhma::all();
     View::make('ryhma/index.html', array('ryhmat' => $ryhmat));
 }