48 $idPlaylist = isset($_GET[
'idPlaylist']) ? (int)$_GET[
'idPlaylist'] :
null;
57 $managerPlaylist =
new PlaylistDAO($this->getPdo());
58 $playlist = $managerPlaylist->findFromUser($idPlaylist, $_SESSION[
'user_email'] ??
null);
65 $chansons = $managerPlaylist->getChansonsByPlaylist($idPlaylist, $_SESSION[
'user_email'] ??
null);
68 $playlistObj = (object) [
69 "getTitreAlbum" =>
function () use ($playlist) {
70 return $playlist->getNomPlaylist();
72 "getUrlImageAlbum" =>
function () {
75 "getArtisteAlbum" =>
function () {
78 "getDateSortieAlbum" =>
function () {
84 $template = $this->
getTwig()->load(
'chanson_album.html.twig');
85 echo $template->render([
87 'title' => $playlist->getNomPlaylist(),
89 'description' =>
"Playlist dans Paaxio"
91 'album' => $playlistObj,
92 'chansons' => $chansons
106 $managerPlaylist =
new PlaylistDao($this->getPdo());
107 $playlists = $managerPlaylist->findAll();
110 $template = $this->
getTwig()->load(
'test.html.twig');
113 echo $template->render(array(
115 'title' =>
"Playlists",
116 'name' =>
"playlists",
117 'description' =>
"Playlists dans Paaxio"
119 'testing' => $playlists,
132 $managerPlaylist =
new PlaylistDao($this->getPdo());
133 $playlists = $managerPlaylist->findAll();
136 $template = $this->
getTwig()->load(
'test.html.twig');
137 echo $template->render(array(
139 'title' =>
"Playlists tableau",
140 'name' =>
"playlistt",
141 'description' =>
"Playlists tableau dans Paaxio"
143 'testing' => $playlists,
Contrôleur dédié à la gestion des playlists.
lister()
Liste toutes les playlists de la plateforme.
listerTableau()
Liste toutes les playlists sous forme de tableau.
__construct(\Twig\Environment $twig, \Twig\Loader\FilesystemLoader $loader)
Constructeur du contrôleur playlist.
afficher()
Affiche une playlist avec ses chansons.
Classe de base pour tous les contrôleurs de l'application.
redirectTo(string $controller, string $method, array $params=[])
Redirige vers un contrôleur et une méthode donnés.
requireAuth(string $controller='', string $method='', array $params=[])
Exige que l'utilisateur soit authentifié.
Twig Loader FilesystemLoader $loader
getTwig()
Récupère l'environnement Twig.