<?php $app->get('/user/show', function () use($app) { $oLaboratory = new models\User(); $users = $oLaboratory->getUsers(); echo json_encode($users); }); $app->post('/user/insert', function () use($app) { $user = $app->request()->post(); $oUser = new models\User(); echo $oUser->insertUser($user); });
<?php // GET login route $app->get('/login', function () use($app) { $login = "******"; $app->render('login.html', array('login' => $login)); }); $app->post('/login', function () use($app) { $user = new models\User(); $usuarios = $user->getUsers(); var_dump($usuarios); echo "tá aqui"; });