Layout#3
Open
rocambille wants to merge 4 commits intoLucBlocker01:masterfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Un peu plus technique : tu as beaucoup de répétitions dans tes fichiers HTML. C'est normal puisque les pages de ton site partage une même structure pour avoir un affichage similaire. Tu peux mettre en place un système de template de vues, une version basique de twig dans Symfony.
Les fonctions PHP pour contrôler les sorties sont très pratiques pour ça : https://www.php.net/manual/en/ref.outcontrol.php
Avec ces outils, tu peux capturer des bouts d'HTML dans des variables pour les injecter ensuite dans un modèle de page réutilisable. Appelons ce fichier
layout.php, requis dans le code ci-dessus :<!doctype html> <html> <body> <?php echo $content; ?> ou une version plus courte permise par PHP : <?= $content ?> </body> </html>Dans tes fichiers HTML, tu peux préparer autant de bloc que tu veux à injecter plus tard dans un layout : styles, scripts (à mettre dans le body, pas en dehors ;) ), contenu main...