Skip to content
Greg Bowler edited this page May 11, 2026 · 88 revisions

WebEngine is an ergonomic toolkit for building web applications using HTML and PHP. It follows a static-first approach: page development begins using plain HTML files, with PHP introduced only when needed. Dynamic behaviour is handled through server-side DOM manipulation, mirroring well-known client-side techniques.

Web frameworks offer many features, but often come with steep learning curves or imposing rules. The motivation behind this project is the belief that what a framework can offer can be achieved by eliminating code rather than adding more.

The core concept behind WebEngine is that applications start static first, the simplest application consisting of a single file at page/index.html (see the Hello World tutorial).

A clean separation of concerns is promoted, as described in application architecture, so that the business logic, page logic and any client side code can be written and maintained separately.

When a page is ready to be made dynamic, PHP files can be added with the same name as their HTML counterparts; index.html is powered by index.php, about.html is powered by about.php, etc. Read more about the relationship between Page Views and Page Logic. Dynamic pages are made possible by binding data to the DOM, and dynamic URIs are made possible by the router.

Who is PHP.GT WebEngine for?

The overall aim throughout GT repositories is to provide an alternative, minimalistic approach to web development. If you're tired of working with the so-called "full stack", there might be something of interest to you here.

All GT repositories are designed to be inclusive to novice developers. Each repository is designed to operate independently, allowing developers to leverage individual components without necessarily needing to adopt the entire framework or possess prior knowledge of WebEngine. This modular approach not only enhances flexibility but also promotes a more focused, purpose-driven development experience.

WebEngine itself provides a "batteries-included" default configuration and has an accessible entry point for beginners. However, its capabilities extend far beyond basic use-cases; WebEngine is robust enough to power large-scale, real-world applications serving millions of users.

Main features

The easiest way to understand WebEngine's feature set is to think in terms of one web request. The browser asks for a URL, WebEngine maps that URL to a page, optional PHP logic runs, and the final document is sent back to the browser.

Some of the main parts of that flow are:

These topics are all covered in the rest of this wiki, and where a subject is maintained in more detail by another PHP.GT package, links are provided out to that package's own documentation.

Separation of concerns

WebEngine is built from small, separately maintained PHP.GT repositories, each with a focused responsibility. You can see the wider set of packages in the PhpGt GitHub organisation or browse the published docs at php.gt/docs.

That separation in the framework encourages the same separation in the applications built with it. HTML can stay in page views, page logic can stay thin, application classes can hold business rules, queries can stay in their own files, and client-side assets can be built separately from PHP. The result is not that there are more moving parts, but that each part has a clear place to live.

How to Read These Docs

These docs are arranged to be read mostly in order. The Overview chapter introduces the ideas behind WebEngine. The next two chapters then move from a tiny working app into the normal page-building workflow of routes, views, logic, input, state, and data.

The tutorials in the Production applications chapter are there to turn those ideas into complete examples. If you're new to WebEngine, it is worth following them in order rather than jumping straight into the reference pages.

The Reference chapter is written for lookup. When you already know that a feature exists and simply want the rule, config key, or command syntax, head there. The Further reading chapter is where the more architectural and opinionated ideas live.


Let's ask the question, What is WebEngine?.

Clone this wiki locally