Exemplo n.º 1
0
 public function RegisterRestUri($app)
 {
     $app->get('/Bars/:id', function ($id) {
         BarsController::onGetBarById($id);
     });
     $app->get('/Bars', function () {
         BarsController::onGetAllBars();
     });
 }
Exemplo n.º 2
0
 <?php 
header('Content-Type: text/html; charset=UTF-8');
error_reporting(E_ALL);
ini_set("display_errors", 'On');
$basedir = realpath(__DIR__);
require_once 'Controllers/BarsController.php';
require_once 'Slim/Slim.php';
\Slim\Slim::registerAutoloader();
$app = new \Slim\Slim();
$barsController = new BarsController();
$barsController->RegisterRestUri($app);
$app->run();