PHP code example of bixev / light-html-template

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

    

bixev / light-html-template example snippets






$tpl = \Bixev\LightHtmlTemplate\Factory::newTemplateFromString($template);
$tpl->pB(
    [
        'var1'        => 'testVal1',
        'myFirstBloc' => [
            'var1'         => 'testFirst1',
            'var2'         => 'testFirst2',
            'var3'         => 'testFirst3',
            'mySecondBloc' => [
                'var'       => 'testSecond',
                'my5thBloc' => [
                    ['var' => 'test4th',],
                    ['var' => 'test5th',],
                ],
            ],
            'myThirdBloc'  => [
                ['var' => 'testThird1',],
                ['var' => 'testThird2',],
            ],
        ],
    ]
);
$result = $tpl->render();

echo $result;

vendor/bin/phpunit --bootstrap vendor/autoload.php ./test/BixevTest/LightHtmlTemplateTest/TplTest.php