Validation & CSRF
// Controller Logic
public function handleForm() {
$data = $this->request->validate([
'username' => 'required',
'email' => 'required|email'
]);
// Auto-redirects back with errors if invalid
}
Automatic Validation & Redirect
HTMX & API
Click to load data from `/api/stats` without page reload using HTMX.
Time:
Try clicking Navigation Links. They use hx-boost
(Global).
<!-- Alpine.js + Fetch (JSON) -->
<button @click="fetch('/api')">Load</button>
<!-- HTMX (HTML Partial) -->
<a href="/about" hx-boost="true">About</a>
Frontend Interaction
Cache
Cached for 60s.
Middleware
Database
Plugin System
Modular architecture with `PluginManager`.
Localization (i18n)
Current Locale: en
"Welcome to Neo Framework"
(A lightweight and powerful PHP framework.)
// Usage in View
<?= app()->lang->get('messages.welcome') ?>
// File: resources/lang/en/messages.php
return ['welcome' => 'Welcome...'];
Locale-based string retrieval
Events & Filters
Demo Filters: Modifying data before output.
* Real filters run on PHP side. See DemoPlugin for backend implementation.
// In DemoPlugin::boot()
$this->app->events->listen('view.render_content', function ($content) {
return $content . "<footer>Hooked!</footer>";
});
Hook Registration
UI Component
Reusable Modal component managed via PHP View Helper.
This is a Reusable Component
This modal is called via $this->component(), keeping views clean.
<?= $this->component('modal', [...]) ?>
<!-- components/modal.php -->
<div x-data=\"{ open: false }\">
<button @click=\"open = true\">Trigger</button>
<div x-show=\"open\">...</div>
</div>
Reusable View Component
Dynamic Routing
Parameters extraction from URL.
// Route
$app->router('/demo/params/{id}', 'GET',
['App\Controllers\DemoController', 'params']
);
// Controller
public function params($params) {
$id = $params['id'];
// ...
}
Routing with Parameters
Session Manager
// Set Session
$app->session->set('key', 'value');
// Get Session
$val = $app->session->get('key');
Session Manipulation
New Features: Mail & Upload
Demonstrating PHPMailer integration and Intervention Image processing.