Added routes and views for both music player designs

This commit is contained in:
gballan1 committed 2016-11-27 21:49:34 -05:00
1 parent 6af63f4bdb
commit 969c1a850a
4 files changed
+96 -8

No files matched your search

+20 -6
View File
@@ -1,13 +1,27 @@
<?php
$app->get('/music', function() use($app) {
// music design #1
$app->get('/music1', function() use($app) {
$albums = $app->album->all()->sortByDesc('release_date')->values()->all();
$albums = $app->album->all()->sortByDesc('release_date')->values()->all();
$songs = $albums[0]->songs;
$app->render('music.twig', [
'albums' => $albums,
$app->render('music.twig', [
'albums' => $albums,
'songs' => $songs,
]);
]);
})->name('music');
})->name('music1');
# music design #2
$app->get('/music2', function() use($app) {
$albums = $app->album->all()->sortByDesc('release_date')->values()->all();
$songs = $albums[0]->songs;
$app->render('music.twig', [
'albums' => $albums,
'songs' => $songs,
]);
})->name('music2');