Moved the main site pages into folders for better project structure
This commit is contained in:
27
app/routes/pages/music.php
Executable file
27
app/routes/pages/music.php
Executable file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
// music design #1
|
||||
$app->get('/music1', function() use($app) {
|
||||
|
||||
$albums = $app->album->all()->sortByDesc('release_date')->values()->all();
|
||||
$songs = $albums[0]->songs;
|
||||
|
||||
$app->render('pages/music1.twig', [
|
||||
'albums' => $albums,
|
||||
'songs' => $songs,
|
||||
]);
|
||||
|
||||
})->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('pages/music2.twig', [
|
||||
'albums' => $albums,
|
||||
'songs' => $songs,
|
||||
]);
|
||||
|
||||
})->name('music2');
|
Reference in New Issue
Block a user