Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSean Flanagan
33,235 PointsNo contact.twig in my work space
Hi.
Does anyone have any idea why I don't have a contact.twig file in my templates folder please? I right-clicked on the sidebar on the left, then clicked Refresh but no contact.twig came up. Thanks.
2 Answers
Mayur Pande
Courses Plus Student 11,711 PointsHi Sean, no problem, that will work, below is what I have used;
$app->get("/contact", function() use($app) {
$app->render("contact.twig"); //change of file extension on this line
})->name('contact');
Mayur Pande
Courses Plus Student 11,711 PointsDo you have a contact.html file? If so you need to change the name to contact.twig and then render it through you index.php file
Sean Flanagan
33,235 PointsHi Mayur. Thanks for your help. My contact.html file now has the .twig extension. And I've changed a line below to reflect this:
$app->get("/contact", function() use($app) {
$app->render("contact.twig"); //change of file extension on this line
});
Have I got it right?
Sean Flanagan
33,235 PointsSean Flanagan
33,235 PointsDone! Thanks Mayur! :)