im having problem understanding Slim PHP, by the way i’m new on this framework.
This first line of code works.
$app->post('/book', function() use ($app){
$app->response();
/**** Some code here ***/
});
but i want so separate the function so I try so make it like this
$app->post('/book', 'addBook');
function addBook() {
$app->response();
/*** Some code here ***/
}
but the code above doesn’t work.
What i’m missing guys?
You can try the getInstance():