Answer the question
In order to leave comments, you need to log in
How to disable Twig template engine in route?
The Twig template engine is bolted to the Slim microframework. On some pages of the site you need bare php code without templating crutches. How to disable Twig in a specific route?
$app->get('/post/:id', function($id) use ($app) {
if ($post = Posts::find($id)) {
$app->render('post.php', array('post' => $post));
}
else {
$app->render('404_post.html');
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question