PHP code example of iluxaorlov / deviant

1. Go to this page and download the library: Download iluxaorlov/deviant 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/ */

    

iluxaorlov / deviant example snippets




use Deviant\Component\Response;
use Deviant\Component\Request;

\App();

// Настройка роутинга
$app->get('/', function(Response $response, Request $request, array $args) {
    return $response->withBody('Hello World');
});

$app->get('/hello/{name}', function(Response $response, Request $request, array $args) {
    $name = $args['name'];
    $response->withBody('Hello, ' . $name);
    return $response;
});

// Запуск приложения
$app->run();