PHP code example of sergiors / templating-service-provider
1. Go to this page and download the library: Download sergiors/templating-service-provider 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/ */
sergiors / templating-service-provider example snippets
use Sergiors\Silex\Provider\TemplatingServiceProvider;
$app->register(new TemplatingServiceProvider(), [
'templating.paths' => '__DIR__.'/../Resources/views/%name%' // or an array
]);
$app['templating']->render(/.../);
use Silex\Provider\TwigServiceProvider;
use Sergiors\Silex\Provider\TemplatingServiceProvider;
$app->register(new TwigServiceProvider(), [
'twig.path' => __DIR__.'/../Resources/views'
]);
$app->register(new TemplatingServiceProvider());
$app['templating']->render(/.../);