Mabs is a PHP micro framework, speedy, light and easy to learn .
- Container
- Event dispatcher
- Routing
- HttpFoundation (Symfony2 component)
- An easy way to extend PHP libraries
You may install the Mabs Framework with Composer (recommended).
$ composer require mabslabs/mabs// web/index.php
<?php
require_once __DIR__.'/../vendor/autoload.php';
$app = new Mabs\Application();
$app->get('hello/(name)', function ($name) {
return 'Hello '.$name;
})->run();// web/index.php
<?php
require_once __DIR__.'/../vendor/autoload.php';
use \Symfony\Component\HttpFoundation\RedirectResponse;
$app = new Mabs\Application();
$container = $app->getContainer();
$app->get('/', function () use ($container) {
$url = $container['router']->generateUrl('hello_page', array('name' => 'World'));
return new RedirectResponse($url);
});
$app->get('hello/(name)', function ($name) {
return 'Hello '.$name;
}, 'hello_page');
$app->run();This bundle is available under the MIT license.