Zero Framework
Zero routing configuration. Zero bloat. Zero dependencies. The framework stays out of your way so you can write your application.
Create a PHP class in modules/, give it a method, and it's an endpoint. That's it.
What is Zero Framework?
Zero is a minimal PHP MVC framework that maps URLs directly to PHP classes. There's no routing table to maintain, no YAML configuration to write, no dependency injection container to wire up. You create a module class, give it public methods, and the framework handles everything else.
The entire framework core is a handful of PHP files you can read in an afternoon. When something breaks, you'll know where to look — because there's nowhere to hide.
How It Works
A URL like /user-profile/edit/42 automatically resolves to UserProfile::edit('42'). Kebab-case URLs map to camelCase class names and methods. Arguments in the URL path become method parameters.
Core Features
route Routing
Automatic URL-to-class mapping with kebab-case conversion and argument unpacking.
widgets Modules
Self-contained application units with controllers, views, models, and assets.
web Views & Responses
Dual HTML/JSON endpoints, frame templates, and flexible response methods.
verified_user Attributes
PHP 8 attributes for authentication, authorization, validation, and auditing.
database Models & Database
Auto-loaded model classes with PDO database connections.
folder_open Asset Management
CSS, JS, and components auto-loaded by naming convention.
account_tree Submodules
Infinitely nestable modules with frame and asset inheritance.
extension Plugins
Lifecycle hooks for extending the framework at key points.
error Error Handling
HTTPError exceptions with custom error views and development diagnostics.
Minimal Example
<?php
namespace Zero\Module;
class Hello extends \Zero\Core\Module {
public function index() {
$this->respond($this->viewPath . 'index.php');
}
public function greet($name = 'world') {
$this->data = ['name' => $name];
$this->respond($this->viewPath . 'greet.php');
}
}
That's a complete module. Visit /hello to see the index, or /hello/greet/claude to greet someone. Send an Accept: application/json header and the same endpoint returns JSON.