Templates & Responses
Templates and view rendering define how your application produces responses and displays content through the chosen template engine. Learn how to structure layouts, render content, and optimize page output.
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.
- View Template Rendering
The View class renders templates with optional caching and layout inheritance, ideal for MVC/HMVC apps where you need structured and fast HTML output.