Phatso

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'
  );

  require_once('phatso.php');
  $app = new Phatso();
  $app->run($URLS);

  function exec_Index(&$app, $params) {
    $app->set('msg', 'Hello World!');
    $app->render('index.php');
  }

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