skateboard/skateboard

Skateboard web app

v1.4 2020-08-14 06:56 UTC

This package is auto-updated.

Last update: 2024-06-12 14:50:55 UTC


README

68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6b69656b6965732f696d6167652f75706c6f61642f76313538383432363233322f7a7467767766617162386368727279747a6c73732e737667

Latest Stable Version Total Downloads License

About Skateboard

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:

Easy routing

// 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

Nimble controllers

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

Environment variables

Sensitive values that you store in your .env file can be accessed anywhere:

$title = getenv("APP_NAME");

Installation

Use Composer to start you project

composer create-project --prefer-dist skateboard/skateboard gallery

License

Skateboard is open-source software licensed under the MIT license.