Example #1
0
<?php

$app->get('/stuffs', function () use($app) {
    $oBook = new models\Stuff();
    $hello = $oBook->getAllStuff();
    $app->response()->header("Content-Type", "application/json");
    echo json_encode($hello);
});
Example #2
0
<?php

// GET index route
$app->get('/', function () use($app) {
    $oStuff = new models\Stuff();
    $hello = $oStuff->setStuff();
    $app->render('index.html', array('hello' => $hello));
});