Gorm, the innkeeper of the Drunken Dragon, is tired of reciting his menu to every adventurer who walks through the door. He wants a web page. You're the only one in the valley who can code: get to work!
The tavern's code was written by a French-speaking crew: classes, properties and route names are in French (
Plat= dish,prix= price,nom= name…). You'll get used to it fast, and it's a good habit to work in a codebase you didn't name.
Your mission
- In
MenuController, declare a route/menunamedapp_menuon theindex()method. - Make it render the template
menu/index.html.twig, passing it aplats(dishes) variable: an array of three dishes of your own invention. - In the template, display an
<h1>title containing “menu”, then the dishes in a<ul class="plats">list, using a Twig loop.
The preview on the right updates on every change. When you think you're done, run the tests: each objective you complete lights up.
Reminder
A Symfony controller is a plain PHP class. AbstractController gives you shortcuts such as render(), which turns a Twig template into a Response.