/calf

Yet another Micro-framework for PHP.

Primary LanguagePHPMIT LicenseMIT

Calf

Travis: Build Status License: MIT

Yet another Micro-framework for PHP.

Installation

composer require jabernardo/calf

Hello World

<?php

require("vendor/autoload.php");

$app = new \Calf\App();

$home = new \Calf\HTTP\Route('/', function($req, $res) {
        return $res->write('Hello World!');
    });

$app->add($home);

$app->run();

Configuring Web Server

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

Running...

php -S localhost:8888 index.php

Testing

phpunit

Learn more

Please see the project's wiki page here.

License

The calf is open-sourced software licensed under the MIT license.