Examples

Devin Smith edited this page Jan 21, 2016 · 33 revisions

Basic usage

use Tipsy\Tipsy;

$app = new Tipsy;
$app->get('home', function($View) {
	$View->display('home', [user => 'crystal']);
});
<h1>Hello <?=$user?></h1>

API & DBO usage

$app->post('drink/:id', function($Params, $Request, $Maitai) {
    $Maitai
        ->load($Params->id)
        ->serialize($Request->request())
        ->save();
    echo $Maitai->json()
});
POST /drink/1?rating=5&name=maitai

Example code

All example code is provided in their own repo with 1 click deployments provided free by Heroku.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.