Added routes and views for both music player designs
This commit is contained in:
		| @@ -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'); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user