PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Nic Latyshev   BlitzTemplateControl   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: BlitzTemplateControl
Process templates using the Blitz PHP extension
Author: By
Last change:
Date: 6 years ago
Size: 553 bytes
 

Contents

Class file image Download
<?php

include_once 'BlitzTemplateControl.class.php';

$data = [
   
'authors' => [
       
0 => ['fname'=>'Lev','lastname'=>'Tolstoi'],
       
1 => ['fname'=>'Vladimir','lastname'=>'Nabokov'],
    ],
];

/* Use templates in one single file with php-array */
$tmplcontrol_in_single_file = new BlitzTemplateControl('SomeClass');

echo
$tmplcontrol_in_single_file->apply('authors',$data);

/* Use templates in separate files in folder */
$tmplcontrol_in_tpl_files = new BlitzTemplateControl('SomeClass',true);

echo
$tmplcontrol_in_tpl_files->apply('authors',$data);

?>