Skateboard is a minimalist PHP framework that is a good starting point for small web projects. Skateboard follows the MVC pattern and has sensible defaults that lets you start with your app-specific code immediately. The framework adds only two library files to your project which brings the following:
// index.php
$router->get('/', '\App\Controller@index');
$router->get('/item/{id}', '\App\Controller@item');
For also using middleware, route parameters, custom 404 responses and route prefixes, see the router docs
class Controller extends Skateboard\Wheels\WebController
{
public function about()
{
$data = [
'host' => $this->getHeaderLine('Host'),
'count' => 15
];
$this->view('about', $data);
}
public function ajax()
{
if (empty($this->input('name'))) $this->abort(422);
$data = [
'name' => "Your name is: {$this->input('name')}",
];
$this->json($data);
}
}
For the full API on parsing request inputs, safe template rendering, template layouts, json responses, aborts and redirects, see the controller docs
Sensitive values that you store in your .env file can be accessed anywhere:
$title = getenv("APP_NAME");
Use Composer to start you project
composer create-project --prefer-dist skateboard/skateboard gallery
Skateboard is open-source software licensed under the MIT license.