Build pages from
database rows, not boilerplate.
WBengine assembles every page from sites, sections and boxes stored in MySQL. Fast native templates, automatic escaping, an API with scoped integration keys, two level caching and real internationalisation, in a framework small enough to read in an afternoon.
- PHP
- 8.3 – 8.5
- No cache
- 7 ms
- Cached page
- 2 ms
- License
- MIT
Median time the core needs to assemble the home page of this skeleton, with every cache off and from the full-page cache, measured in an isolated local environment. Not a website speed test. Method and results
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, roles, scoped integration keys and login rate limiting.
API v2
API v2 with scoped integration keys for content, structure, users, translations and the cache, and an audited change log.
Central administration
A separate private SvelteKit app can manage content across sites through scoped HTTPS API connections.
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