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 Routing in Slim

Luis Brito
Luis Brito
24,527 Points

I am stuck with task 2 of Building Websites with PHP Have the get route closure echo 'Hello There'

I am stuck with the echo part, not sure where exactly I have to add it

index.php
<?php
require 'Slim.php';

$app = new \Slim\Slim();

/*  add your code below this line */
$app->get('/hello', function () use($app){
    echo('Hello There')
});

/* add your code above this line */

$app->run();

2 Answers

Hello Luis Brito,

You are so close to getting this right!

You put everything in the right place you are just missing the ending semi-colon after the echo statement to end the code statement.

<?php
echo('Hello There');
?>

Hope this helps!

Luis Brito
Luis Brito
24,527 Points

Sam thank you very much this helped me a lot :)