Triangle View provides a small adapter layer for rendering PHP templates and, when installed, Blade, Twig, or ThinkPHP templates.
- PHP 8.1 or newer.
- Triangle Engine
^8.1or^9.0. - Engine 9 runs on Localzet Server 7; Engine 8 remains supported for existing applications.
Install the package with Composer:
composer require triangle/view:^2.1The package's Install helper copies the default view.php configuration into the application's config directory when it does not already exist. The default handler is raw; set VIEW_HANDLER to blade, twig, or think to select an optional adapter. Install the corresponding template engine package separately.
By default, a template named page for the dashboard application is loaded from app/dashboard/view/page.phtml. The view() helper returns an Engine response and merges variables assigned to the current request with the variables passed to the helper; explicit helper variables take precedence.
The raw handler executes PHP templates and does not escape output automatically. Escape untrusted values in the template, for example with htmlspecialchars($value, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8').
Run the Engine compatibility and rendering integration check with:
composer testFor Russian documentation, see README.ru.md.
Copyright © 2016-2026 Localzet Group. All rights reserved.