jabernardo / calf
A slim router for PHP Web Applications
1.0.1
2021-05-15 15:24 UTC
Requires
- php: >=7.0
- jabernardo/saddle: ^0.1.0
Requires (Dev)
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2025-03-29 00:39:14 UTC
README
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.