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 trialIlonka Hofmann
4,916 PointsIncluding & Rendering: html file is showing white screen
I've created the templates folder, I've copied the html into the new html file inside the templates folder. The contact page is rendering, just the html one isn't unless I type /index.html in the viewer Here is my code:
<?php
require '/vendor/autoload.php';
date_default_timezone_set('Australia/NSW');
$app = new \Slim\Slim();
$app->get('/', function() use($app){
$app->render('index.html');
});
$app->get('/', function() use($app){
$app->render('contact.html');
});
$app->run();
MOD edited to format code
3 Answers
kabir k
Courses Plus Student 18,036 PointsIn the rendering for the contact.html page, do
$app->get('/contact', function() use($app){
$app->render('contact.html');
});
Ted Sumner
Courses Plus Student 17,967 PointsYou are currently sending / to two different places.
Ilonka Hofmann
4,916 PointsI don't know how I missed that! I've fixed it but the white screen is still there. I think I might have to start over:(
Ted Sumner
Courses Plus Student 17,967 PointsI am trying to help another student figure this same issue out in another thread. Let me link it and maybe we can figure it out together.