PHP code example of herrera-io / template

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


$engine = Herrera\Template\Engine::create('/path/to/templates');

$engine['myGlobal'] = 123;

$engine->display('myTemplate.php', array('templateVar' => 456));

<p>myGlobal:  echo $myGlobal;