public
Description: Sinatra-inspired DSL for Zend Framework and PHP 5.3
Homepage:
Clone URL: git://github.com/monzee/snap-framework.git
name age message
file README.md Loading commit data...
directory data/
directory forms/
directory library/
directory models/
directory public/
directory tests/
directory views/
README.md

Snap

Snap is a thin framework layered on top of Zend Framework. It acts as a facade of sorts to Zend_Controller_Front and friends that combines the routing and dispatch processes into a single interface. It is inspired by the Sinatra Ruby framework.

Step 1: Load the Snap library

<?php
// public/index.php
namespace snap;

require '../library/snap/Snap.php';
Snap::autoload('../library');

Step 2: Define the routes and actions

get('/hello')->do(function () {
    echo 'Hello world!';
});

Step 3: Run!

dispatch();

Step 4: See the results

Point your browser at http://localhost/public/index.php/hello

More documentation coming soon at my blog.

Demo

The demo is a work in progress. It also requires Doctrine, which I did not include in the project. Download it separately and extract it into the library folder or add its path directly in the php.ini include_path setting.