# Dumbo A lightweight, friendly PHP framework for HTTP — inspired by Hono. [Join us on Discord](https://discord.gg/nAq2h9BfsU) ![Dumbo](/dumbo.jpeg) ## Install ```bash composer require notrab/dumbo ``` ## Quickstart Here's a basic example of how it works! ```php get("/", function ($context) { return $context->json(["message" => "Hello, Dumbo!"]); }); $app->run(); ``` See the [examples](/examples) directory for more quickstarts. ## Routing ```php get('/users', function($context) { /* ... */ }); $app->post('/users', function($context) { /* ... */ }); $app->put('/users/:id', function($context) { /* ... */ }); $app->delete('/users/:id', function($context) { /* ... */ }); ``` ### Params ```php get('/users/:id', function($context) { $id = $context->req->param('id'); return $context->json(['id' => $id]); }); ``` ### Nested ```php get('/nested', function($context) { return $context->text('This is a nested route'); }); $app->route('/prefix', $nestedApp); ``` ## Context ```php get('/', function($context) { $pathname = $context->req->pathname(); $routePath = $context->req->routePath(); $queryParam = $context->req->query('param'); $tags = $context->req->queries('tags'); $body = $context->req->body(); $userAgent = $context->req->header('User-Agent'); }); ``` ### Response ```php json(['key' => 'value']); return $context->text('Hello, World!'); return $context->html('