Closed celovec closed 2 years ago
How to render template is described in docs
$latte = new Latte\Engine;
$latte->setTempDirectory('/path/to/tempdir');
$parameters['items'] = array('one', 'two', 'three');
$latte->render('template.latte', $parameters);
Just use $data = $latte->renderTostring();
and put data in response, like any other
I'm looking for a Slim user to help create an analogy of https://github.com/slimphp/Twig-View for Latte
Check out https://github.com/ujpef/latte-view It works with Slim 3.0
Here is a blog post for Slim 4: https://odan.github.io/2022/04/06/slim4-latte.html
Great, thank you!
@odan would you mind if I put your article directly on the Latte website? https://latte.nette.org/en/cookbook/slim-framework
@dg That's fine. 👍
Great!
I installed the library with composer. Please show an example of how to configure it to work with slim 3