PHP code example of mickaelandrieu / twig-skill

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

    

mickaelandrieu / twig-skill example snippets




is = new Jarvis\Jarvis([
    'container_provider' => [
        'Jarvis\Skill\Twig\ContainerProvider',
    ],
    'twig' => [
        'templates_paths' => '/path/to/templates',
    ],
]);



e_once('./../config.php');

use Jarvis\Jarvis;
/* ... */

$jarvis->router->addRoute('get', '/', function ($jarvis) {
    return $jarvis->twig->render('index.twig', ['world' => 'World']);
});

$response = $jarvis->analyze();

$response->send();