TrueFramework
A small, opinionated PHP framework for building real applications fast. Routing, views, database access, forms, and email — bundled, autoloaded, and out of your way.
What's in the box
Pulling in the truecastdesign/truefw scaffold gives you a working project with three libraries already wired up:
- true — the core. Application bootstrap, router, request/response, and a PHP-based view engine.
- hopper — a thin PDO wrapper for MySQL and SQLite with a
get($sql, $params, $type)shorthand for the patterns you write a hundred times a project. - welder — a form builder with validation, anti-spam, and one-line render output.
Everything is autoloaded by Composer. Boot a fresh project and you can write a route handler that talks to the database and renders a template without installing anything else.
Bring your own. The bundled libraries are the path of least resistance — they're not lock-in. You can drop in Doctrine, Eloquent, Symfony Forms, or anything else for the bits you'd rather control. See Use a different DB library and Use a different form library.
Start here
Installation
Composer one-liner, project layout, and your first dev server.
Hello World
The smallest possible app — a route, a controller, a response.
Application Lifecycle
What init.php does, what $App is, and the order requests are handled.
Routing
HTTP verbs, route patterns, placeholders, groups, and middleware.
Database (Hopper)
Connecting, reading, writing, and deleting with the bundled wrapper.
Forms (Welder)
Build, validate, and submit forms with one fluent helper.
Philosophy
TrueFramework is built around three rules:
- Plain PHP, plain files. Controllers are flat
.phpfiles. Views are.phtml. There's no compile step, no service container DSL, no annotations. - One way to do common things. The router, request, response, and view live on one
$Appobject. You don't shop for "the right" routing library — there's one already there. - Pluggable where it matters. Database and forms are libraries, not pillars. Use the bundled ones until they don't fit, then swap.