PHP code example of herrera-io / silex-template

1. Go to this page and download the library: Download herrera-io/silex-template 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/ */

    

herrera-io / silex-template example snippets




use Herrera\Template\TemplateServiceProvider;
use Silex\Application;

$app = new Application();

$app->register(new TemplateServiceProvider(), array(
    'template.dir' => '/path/to/dir',
    'template.dir' => array(
        '/path/to/dir1',
        '/path/to/dir2',
        '/path/to/dir3',
    )
));

$app['template.engine']->render('test.php');