PHP code example of niklas / template

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

    

niklas / template example snippets


$template = new Template("testIndex.html");

echo "Content is below the testSide, becouse the maincontent tags (%%)";

$template->set("title", "Hello");
$template->assign(["test"=>"search","test2"=>"And", "test3"=>"Replace"]);
$template->append("newFile", "testSide.html");

echo $template->render();