Added routes and views for both music player designs

This commit is contained in:
gballan1
2016-11-27 21:49:34 -05:00
parent 6af63f4bdb
commit 969c1a850a
4 changed files with 96 additions and 8 deletions

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');