PHP code example of yakeing / php_template

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

    

yakeing / php_template example snippets


    //Template path
    $tpl = new template("/home/www/mould/");

    $tpl->assign("title","I was the title");
    $tpl->assign("arr",array('aaa','bbb','ccc'));

    //The transfer of files at the same time output
    $tpl->GetFile("header.html")->GetFile("index.html")->GetFile("footer.html")->render();

    {foreach $array as $key => $value}...{$key} => {$value}...{/foreach}

    $ composer 

    {if $array}...{elseif $array[0]!=null}...{else}...{/if}

    {for ($i=0;$i<count($array);$i++)}...{$array[$i]}...{/for}

    {$i = 1} OR {$t=2}
    {$i++}
    {$i--}