Templates
Slim does not have a view layer like traditional MVC frameworks. Instead, Slim’s “view” is the HTTP response. Each Slim application route is responsible for preparing and returning an appropriate PSR-7 response object.
Slim’s “view” is the HTTP response.
That being said, the Slim project provides the Twig-View and PHP-View components to help you render templates to a PSR7 Response object.
The slim/twig-view component
The Twig-View PHP component helps you render Twig templates in your application. This component is available on Packagist, and it’s easy to install with Composer like this: