//index.php file
require_once('src/OnePHP/one_framework.php');
$app = new \OnePHP\App();
$app->get('/',function() use ($app){//Action
echo 'Hello world';
});
$app->listen();Examples
//$id_book will be the value passed on the URL
$app->put('/book/:id_book/',function($id_book) use ($app){
//update...
});
$app->delete('/book/{id_book}/',function($id_book) use ($app){
//delete...
});$app->respond( function() use ( $app ){
return $app->ResponseHTML('<p> This is a response with code 404. </p>', 404);
});<a href="<?php echo $app->generateRoute('/about'); ?>"> About </a>
<a href="<?php echo $app->generateRoute('/book/'.$id_book.'/edit'); ?>">
Edit $book
</a>