A shared layout

Exercise 3 of 7 in chapter 6 · 150 XP · 4 objectives checked by tests

Topics covered: TemplateLayoutEnum::cases()

One big block of HTML is still stuck inside PHP: the layout in Page::rendre(), squeezed into a heredoc. It deserves its own template. And while we're at it, Gaston wants a menu to go straight to the weather.

Your mission

  1. Move the HTML of Page::rendre() into templates/mise-en-page.php (layout), with <?= ... ?> for each value. The tab title goes through htmlspecialchars(), the content does not: it is already HTML.
  2. Page::rendre() now only renders this template with Vue::rendre().
  3. In the masthead (inside <header class="entete">), under the weather report, add the <nav class="rubriques"> menu: a link to the page of each section, with its label.
  4. Build this menu from the enum: a section added to Rubrique one day will show up in it on its own.

Reminder

Rubrique::cases() returns the list of all the cases of the enum, in the order they are declared. A template is a PHP file like any other: it starts with the use statements of the classes it uses.