Clean Framework · DOCUMENTATION
Render a native PHP view
Render a native PHP view
Steps
Choose the template in controller code and pass presentation arrays. Keep business rules, database reads, and provider calls outside the view.
// Native template excerpt: $items and $e are supplied by the renderer.
<?php foreach ($items as $item): ?>
<a href="/reading/<?= $e(rawurlencode($item['slug'])) ?>">
<?= $e($item['title']) ?>
</a>
<?php endforeach; ?>The framework keeps PHP as its template language. Do not let a query parameter choose an include path. View rendering and code-example display are different: documentation code is escaped text, never evaluated.
Verify
Pass a title containing HTML and verify inert escaped output. Read Views and list template source.
Editorial provenance
Source: resources/guides/php-view.md. Source SHA-256: 082f2b84287fbbdb0e5b31ec51a43e61786f7f20977718f5415689999fcddca2.
Knowledge-base application source; editorial checkpoint 2026-10-20. See candidate status and adoption boundary.