PHP code example of seblucas / dot-php

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

    

seblucas / dot-php example snippets


// Load the library
te
$page = file_get_contents('templates/page.html');

// instanciate the object
$template = new doT();

// Compile your templace in a PHP function ($dot)
$dot = $template->template($page);

// the data is simple PHP array
$data = array('title' => 'My custom title');

// Write the HTML
echo $dot($data);