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 trial

PHP Building Websites with PHP Slim Basics & Twig Templates Including & Rendering

Index shows fine when using url localhost/ however white screen on localhost/contact

Index seems to work fine however contact just shows a white screen. No error just white. code is as follows

<?php require DIR . '/vendor/autoload.php'; date_default_timezone_set ('America/Louisville');

// $log = new Logger('name'); // $log->pushHandler(new StreamHandler('app.txt', Logger::WARNING)); // $log->addWarning('Oh NO!');

$app = new \Slim\Slim();

$app->get('/', function() use($app) { $app->render('index.html'); });

$app->get('/contact', function() use($app) { $app->render('contact.html';) });

$app->run();

My index.html and contact.html are in the templates folder

1 Answer

Dan Slanger
Dan Slanger
7,639 Points

Andrew,

I think it's just a typo / misplaced semicolon: The broken contact.html line of code has its semicolon on the inside of the closing parenthetical but should have it on the outside of the parenthetical to match the index.html line of code.