Build pages from
database rows, not boilerplate.
WBengine assembles every page from sites, sections and boxes stored in MySQL. Fast native templates, automatic escaping, a REST API with roles, two level caching and real internationalisation, in a framework small enough to read in an afternoon.
- PHP
- 8.3 – 8.5
- Runtime packages
- 2
- Cached page
- 0 SQL
- License
- MIT
class Hello extends WbengineBoxAbstract
{
public function Hello()
{
// a row in cms_boxes points here
return $this->getRenderer()->render(
$this->getBoxTemplatePath(),
['name' => 'World']
);
}
}
Features
Everything a content site needs, nothing it does not
Each card opens a page of this application that explains the feature and, below the text, shows it working on the request you are looking at.
Sites, sections, boxes
A URL selects a site, the site loads its sections, each section runs its boxes. The whole page is data.
Boxes
Static or dynamic units of content: a class, a method and a template. Add a page without touching the framework.
Native templates
An independent native template engine compiled to PHP, with automatic HTML escaping and fragment caching.
Languages
URL, cookie and header detection, plural rules, number and date formats, and translated database content.
Caching
A data cache and a full page cache for anonymous visitors: a cached page costs no database query.
Security
Bound parameters, hashed passwords, rotating refresh tokens, roles and login rate limiting.
REST API
JWT authentication and role based endpoints for users, sections, translations and the cache.
Articles
A bundled article box with built-in Markdown, an explicit database format and translated content.
Request lifecycle
From a URL to a page in four steps
The same four steps run for every request. Open the architecture page to see them with the real queries.
- 1
Match the site
The URL is looked up in cms_sites. No row: 404. The language prefix is read first and removed.
- 2
Load the sections
Each active section asks cms_boxes which boxes belong to this site, in order.
- 3
Run the boxes
A box is a PHP method that returns HTML, usually from a model and a template.
- 4
Render the layout
The section HTML lands in site.tpl. Anonymous pages can be stored whole by the page cache.
Run it in two minutes
The skeleton ships with a Docker setup, a demo database and an administrator account.
git clone https://github.com/rrsoftcz/wbengine-skeleton-app
docker compose up -d --build