PHP code example of psecio / slimtwig

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

    

psecio / slimtwig example snippets



 = new \SlimTwig\App();
$app->get('/', function() {
    $data = ['username' => 'ccornutt'];
    echo $this->view->out('template.php', $data);
});

$app->run();


$config = [
    'settings' => [
        'template_path' => __DIR__'/my/template/path'
    ]
]
$app = new \SlimTwig\App();