vraiment beau boulot
This commit is contained in:
30
codeigniter/application/views/artistes_list.php
Normal file
30
codeigniter/application/views/artistes_list.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<h5>Artistes list</h5>
|
||||
<section class="list">
|
||||
<?php
|
||||
$artistAlbums = array();
|
||||
|
||||
foreach ($artistes as $artist) {
|
||||
|
||||
if (!array_key_exists($artist->artistName, $artistAlbums)) {
|
||||
$artistAlbums[$artist->artistName] = array();
|
||||
}
|
||||
$artistAlbums[$artist->artistName][] = array(
|
||||
'albumName' => $artist->albumName,
|
||||
'year' => $artist->year
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($artistAlbums as $artistName => $albums) {
|
||||
echo "<div><article>";
|
||||
echo "<header class='short-text'>";
|
||||
echo "<h2>$artistName</h2>";
|
||||
echo "</header>";
|
||||
echo "<ul>";
|
||||
foreach ($albums as $album) {
|
||||
echo "<li>" . $album['albumName'] . " - " . $album['year'] . "</li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
echo "</article></div>";
|
||||
}
|
||||
?>
|
||||
</section>
|
Reference in New Issue
Block a user