PHP code example of ehough / contemplate

1. Go to this page and download the library: Download ehough/contemplate 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/ */

    

ehough / contemplate example snippets


$template = new ehough_contemplate_impl_SimpleTemplate();  //implements ehough_contemplate_api_Template
$template->setPath('/some/path/to/template.html.php');

$template->setVariable('foo', 'bar');
$template->setVariable('baz', array('one' => 'two'));

echo $template->toString();