PHP code example of html5 / template

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

    

html5 / template example snippets


$template = new HtmlTemplate();
echo $template->render("template.xhtml", ["showHeader" => true, "producs"=> [ new Product("prod1"), new Product("Product2)" ]]);
html
<div go-foreach="data as curKey => curVal">
    Key: {{curKey}} Value: {{curVal}}
</div>

<div go-foreach="products as product">
    <go-continue go-if="product.isHidden == true"/>
    ...
</div>

sudo add-apt-repository ppa:pinepain/libv8-5.2
sudo apt-get update
sudo apt-get install libv8-dev  g++ cpp php-pear php7.0-dev
sudo pecl install v8js

sudo bash
echo "extension=v8js.so" > /etc/php/7.0/apache2/conf.d/20-v8js.ini
echo "extension=v8js.so">/etc/php/7.0/cli/conf.d/20-v8js.ini

service apache2 restart