Phatso is a micro framework for PHP. It is very small (~100 lines) and simple, focusing purely on a basic dispatch and template functionality.

Phatso is intended for smaller PHP projects that can often be elegantly contained within a single PHP file. The idea is to write your app as you normally would (sans framework), but use Phatso to map URLs to different actions, and separate your application's logic and presentation. This helps you to organize your application logic in a cleaner way and avoid spaghetti code.

There is no database support in the primary Phatso script. However, a simple PDO-based driver is included as an auxiliary script, and provides a number of convenience methods for standard SQL operations.

View or Download the Phatso source code.

Here is an example of a script using Phatso:

  $URLS = array(
    '/dostuff/'    => 'Stuff',
    '/'            => 'Index'

  $app = new Phatso();

  function exec_Index(&$app, $params) {
    $app->set('msg', 'Hello World!');

  function exec_Stuff(&$app, $params) {
    // do some cool stuff