PHP code example of glaubinix / silex-twig-engine
1. Go to this page and download the library: Download glaubinix/silex-twig-engine 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/ */
glaubinix / silex-twig-engine example snippets
// Register the twig service provider
$app->register(new \Silex\Provider\TwigServiceProvider(),
[
// your twig config
]
);
// Register the twig service provider
$app->register(new \Glaubinix\TwigEngine\TwigEngineServiceProvider());
// The engine is now available under the same identifier as in symfony
$app['templating']->render('template', []);