$gamedev = new GameDev(); $options = array('callback' => trim($_GET['callback'])); if ($type === 'hasil') { $gamedev->get_api_results($options); } else { if ($type === 'isi') { $gamedev->get_api_others($options); } else { $gamedev->get_api_results($options); } } }); // POST route $app->post('/formulir/post', function () { $gamedev = new GameDev(); $gamedev->save_users_inputs(); }); $app->post('/formulir/kunci', function () { $gamedev = new GameDev(); $gamedev->save_users_key_request(); }); // PUT route $app->put('/put', function () { echo 'This is a PUT route'; }); // PATCH route $app->patch('/patch', function () { echo 'This is a PATCH route'; }); // DELETE route $app->delete('/delete', function () {