コード例 #1
0
ファイル: playlist.php プロジェクト: laiello/atm-music
 public function action_add_playlist()
 {
     $user = $this->is_logged();
     if ($user === false) {
         return Redirect::to_action('login');
     } else {
         $play = new Playlist();
         if (isset($_POST['playlist']) and $_POST['playlist'] != "") {
             $play->set_name_playlist($_POST['playlist']);
         } else {
             $this->_error_form = true;
             $this->_error_msg .= "Il y a une erreur dans le nom";
         }
         if ($this->_error_form == false) {
             $play->set_update(date('y-m-d'));
             $this->_error_msg .= "Ajout réussi!";
             $play->add();
             return Redirect::to_action('playlist');
         }
         return Redirect::to_action('playlist@add');
     }
 }