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 trialBurak Tomrukcu
6,402 PointsI cannot see index.html
I created templates folder and added index.html and contact.html. Altough i can reach contact.html index.html doesn't show up.
<?php
Having: error_reporting(-1); ini_set('display_errors', 'On');
require __DIR__ . '/vendor/autoload.php';
date_default_timezone_set('Europe/Istanbul');
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
//$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();
2 Answers
Damian Saunders
23,000 PointsHi Burak, Looks like you're missing the $ on app in your functions - should be $app->render...
Cheers Damian
thomascawthorn
22,986 PointsAre you by any chance looking for .twig instead of .html?
Robert Richey
Courses Plus Student 16,352 PointsRobert Richey
Courses Plus Student 16,352 PointsHi Burak,
I added markdown to help make the code more readable. If you're curious about how to add markdown like this on your own, checkout this thread on posting code to the forum . Also, there is a link at the bottom called Markdown Cheatsheet that gives a brief overview of how to add markdown to your posts.
Cheers!