Skip to content

Instantly share code, notes, and snippets.

@julp
Last active October 12, 2019 19:45
Show Gist options
  • Save julp/2ba97bb10ae5806d1a8fab52bad8f8aa to your computer and use it in GitHub Desktop.
Save julp/2ba97bb10ae5806d1a8fab52bad8f8aa to your computer and use it in GitHub Desktop.
[OC] Simplification de code
const COLUMNS = [
'human' => ['Interprétation', 'icone_interpret.jpg'],
'tutti' => ['Tutti', 'iconeTous_mp3.png'],
'S' => ['Soprano', 'iconeS_mp3.png'],
# à compléter
];
foreach (COLUMNS as $c => $s):
?>
<div class="text-center <?php if (empty($donnees[$c])) { echo 'invisible">'; } else { ?>">
<p class="tutti"><?= htmlspecialchars($s[0], ENT_NOQUOTES) ?></p>
<a href="mp3/<?= $donnees[$c] ?>" target="_blank">
<img class="icone" src="icones/<?= $s[1] ?>"></a>
<?php } ?>
</div>
<?php endforeach ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment