Skip to content

JannieT/skateboard

Repository files navigation

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.

About

Elegant starting point for small web projects

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages