-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanother-way.php
48 lines (35 loc) · 1.19 KB
/
another-way.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/***********************
Nikházy Ákos
another-way.php
This is another example for the same template.
Here we fill the tagList in another style using
the array('key' => 'content') style.
This is a more compact way to fill the tag list.
***********************/
require 'require/head.php';
$cache = new Cache(10);
$template = new Template('index');
$listLineTemplate = new Template('listItem');
$rawTextTemplate = new Template('',' {{texthere}} at rendering');
$text = new Text('index');
$list = '';
for($i = 1; $i<=10; $i++)
{
$listLineTemplate -> tagList['item'] = $text->PrintText('listItemText') . $i;
$list .= $listLineTemplate->Templating(true,false);
}
$rawTextTemplate -> tagList['texthere'] = $text -> PrintText('complete');
// ****************
//
// This is the another style / form to fill the tagList
//
// ****************
$template -> tagList = array(
'someText' => $text->PrintText('someText'),
'content' => 'This is simple text in the code',
'aList' => $list,
'otherHTML' => NULL,
'rawStringExample' => $rawTextTemplate -> Templating()
);
$cache -> cache($template -> Templating());