PHP code example of sharpdressedcodes / keletos

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

    

sharpdressedcodes / keletos example snippets


use Keletos\Component\Routing\Router;
use Application\Controller\Main as MainController;

Router::match(['GET', 'POST'], '/', MainController::class);

Router::get('/test/{id<\d+>?1}', function($id = -1) {
    echo 'no controller!!! ' . $id;
});

Router::get('/user/{name<\w+>}', function($name) {
    echo "name is $name";
}, [
    '

use Keletos\Component\Application\Application;
//use Keletos\Component\ConfigManager;
//use Keletos\Component\Rendering\Renderer;
//use Keletos\Component\Routing\Router;

(function() {

    $basePath = dirname(__DIR__);

    ') . '.php');
    //$router = new Router(['web'], $renderer, $basePath);

    $application = Application::factory([
        'routes' => ['web'],
        'basePath' => $basePath,
        //'renderer' => $renderer,
        //'router' => $router,
        //'configManager' => $configManager,
    ]);

    $application->run();

})();