PHP code example of minorwork / twig-view
1. Go to this page and download the library: Download minorwork/twig-view 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/ */
minorwork / twig-view example snippets
use MinorWork\App;
// index.php
$app = new App();
$app->set('view', '\MinorWork\View\TwigView');
// in your request handler
$app->view->basePath('/path/to/your/templates');
$app->view->prepare('template.twig', ['title' => 'Doctor', 'name' => 'Strange Love']);