Пример #1
0
 public function action_display()
 {
     $user = $this->is_logged();
     if ($user === false) {
         return Redirect::to_action('login');
     } else {
         $id_playlist = URI::segment(3);
         $adminPlaylist = new adminPlaylist($user->get_id_user_lif(), $id_playlist);
         if ($adminPlaylist->check_exists() == 1) {
             $song_array = array();
             $all = SongPlaylist::all_from_ids($id_playlist);
             foreach ($all as $value) {
                 $song = new Song($value->id_song);
                 $song->load();
                 array_push($song_array, $song);
             }
             $playlist = new Playlist($id_playlist);
             $playlist->load();
             return View::make('playlist.display')->with('playlist', $playlist)->with('songs', $song_array);
         } else {
             return Redirect::to_action('home@index');
         }
     }
 }