PHP code example of mabslabs / mabs

1. Go to this page and download the library: Download mabslabs/mabs library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mabslabs / mabs example snippets


// web/index.php


ation();

$app->get('hello/(name)', function ($name) {

    return 'Hello '.$name;
})->run();


// web/index.php


\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();