PHP code example of crazedsanity / template

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

    

crazedsanity / template example snippets


$recordSet = array(
			0 => array(
				'primary_id'    => 1,
				'record_name'   => 'The First Record',
				'another_field' => 'field value',
				'is_active'     => 0,
			),
			1 => array(
				'primary_id'    => 3,
				'record_name'   => 'A third record',
				'another_field' => 'something else',
				'is_active'     => 1,
			),
);
$tmpl = new Template(__DIR__ .'/path/to/file.tmpl');
$output = $tmpl->renderRows($recordSet);