diff --git a/app/routes/music.php b/app/routes/music.php index 2e1ea9e..628a2ba 100755 --- a/app/routes/music.php +++ b/app/routes/music.php @@ -1,13 +1,27 @@ 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'); diff --git a/app/views/music.twig b/app/views/music1.twig similarity index 97% rename from app/views/music.twig rename to app/views/music1.twig index c5784b7..d9fea54 100644 --- a/app/views/music.twig +++ b/app/views/music1.twig @@ -5,7 +5,7 @@ {% endblock %} -{% block title %}Music{% endblock %} +{% block title %}Music Design #1{% endblock %} {% block content %} diff --git a/app/views/music2.twig b/app/views/music2.twig new file mode 100644 index 0000000..52b6eb2 --- /dev/null +++ b/app/views/music2.twig @@ -0,0 +1,71 @@ +{% extends 'templates/default.twig' %} + +{% block javascripts %} + + +{% endblock %} + +{% block title %}Music Design #2{% endblock %} + +{% block content %} + +
+

Music

+
+ + +
+ + + + +
+
+ {{ albums[0].title }} +
+

{{ albums[0].title }}

+ {% if albums[0].description %} +
+

{{ albums[0].description }}

+ {% endif %} +
+
+
+ + +
+
+ +
+ +
+
    + {% for song in songs %} +
  • + {{ song.track_order }}. {{ song.title }} +
  • + {% endfor %} +
+
+
+
+ + +
+ {% for album in albums %} + +
+
+ {{ album.title }} +
+
{{ album.title }}
+
+
+
+ {% endfor %} +
+ +{% endblock %} diff --git a/app/views/templates/partials/header.twig b/app/views/templates/partials/header.twig index 5a88d9e..ac2d2f6 100755 --- a/app/views/templates/partials/header.twig +++ b/app/views/templates/partials/header.twig @@ -29,7 +29,10 @@ Shows +