PHP code example of susros / html-template-engine

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

    

susros / html-template-engine example snippets




HTMLTemplateEngine::$DIRECTORY = $_SERVER["DOCUMENT_ROOT"] . "/view";

$myTemplate = new HTMLTemplateEngine("template_name.tpl");

$myTemplate = new HTMLTemplateEngine(HTMLTemplateEngine::package1("cat1/template1"));

$myTemplate->msg = "Good Morngin!";

$myTemplate->name = array(“John”, “Will”, “Josh”, “Kelvin”);
$myTemplate->id = array(1,2,3,4);

$myTemplate->greeting = "Hello, World!";
html
<select>
	{#dup : <option value="{$id}">{$name}</option> ;}
</select>