<?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); });
<?php // GET index route $app->get('/', function () use($app) { $oStuff = new models\Stuff(); $hello = $oStuff->setStuff(); $app->render('index.html', array('hello' => $hello)); });