stave.dev

Zero Framework

Zero routing configuration. Zero bloat. Zero dependencies. The framework stays out of your way so you can write your application.

Quick Start

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

URL Request
Application
Parse URL
Module::endpoint()
Response

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

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.