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 trialdevope devope
11,490 PointsPHP Fatal error: Call to undefined function render()
- I have this index.php
<?php
require 'vendor/autoload.php';
$app = new \Slim\Slim(array(
'view' => new \Slim\Views\Twig()
));
$view = $app->view();
$view->parserOptions = array(
'debug' => true
);
$view->parserExtensions = array(
new \Slim\Views\TwigExtension(),
);
$app->get('/', function() use($app){
$appβ>render('about.html');
});
$app->get('/contacts', function() use($app){
$appβ>render('contact.html');
});
$app->run();
- And get error
This page isnβt working
localhost is currently unable to handle this request.
HTTP ERROR 500
- Also in the terminal console I get this
Call to undefined function render()
BTW question for teacher and Treehouse platform: what's the problem with this course to resolve it? I see many unanswered questions about the same problems.
Thank you anyway!