PHP code example of pyrsmk / lumy3

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

    

pyrsmk / lumy3 example snippets


$app = new Lumy\App();

// Add a service
$app['twig'] = $app->service(function($app) {
    $loader = new Twig_Loader_Filesystem('/path/to/templates');
    $twig = new Twig_Environment($loader, [
        'cache' => '/path/to/compilation_cache',
    ]);
});

// Add a route
$app->get('/', function($request, $response) {
    // Render the template
    $this['twig']->render('index.html', [
      'the' => 'variables',
      'go' => 'here'
    ]);
});

$app->run();