Templates & Responses
Templates and responses define how your application displays content using the chosen template engine. Learn how to return views, render data, and manage different response formats.
Table of Contents
- PHP Layout Composition and Inheritance
Template Layout allows PHP layout composition, including sections, nesting, and template selection. It provides a flexible system for building page layouts when using the default template engine.
- View Response Object
The Response class allows you to send raw output, JSON, or files directly to the browser, client, or as a controller method response for routing. Perfect for APIs, JS frameworks, or dynamic endpoints.
- Smarty Template Engine Extension
Render templates efficiently with Luminova’s Smarty extension helpers that reduce unnecessary class loading and keep your application fast and easy to maintain.
- Twig Templete Engine Extension
Using the Twig template engine, to efficiently render templates and minimizing class initialization to save you the time and effort of manually registering classes and functions.
- Template Rendering and View Object
The View class renders templates with optional caching and layout inheritance, ideal for MVC/HMVC apps where you need structured and fast HTML output.