-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aleksandr-ru
committed
May 24, 2016
1 parent
15803d5
commit 8c2f105
Showing
3 changed files
with
94 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>{{TITLE}}</title> | ||
</head> | ||
<body> | ||
<h1>{{TITLE}}</h1> | ||
<hr> | ||
<!-- BEGIN head --> | ||
<p>This is the header</p> | ||
<p>Global var: {{GLOBAL}}</p> | ||
<!-- END head --> | ||
<hr> | ||
<!-- BEGIN content --> | ||
<table border="1"> | ||
<caption>This is the content</caption> | ||
<tr> | ||
<th>Column-1</th> | ||
<th>Global</th> | ||
</tr> | ||
<!-- BEGIN row --> | ||
<tr> | ||
<td>{{COL|html}}</td> | ||
<td>{{GLOBAL}}</td> | ||
</tr> | ||
<!-- END row --> | ||
</table> | ||
<!-- END content --> | ||
<hr> | ||
<!-- BEGIN foot --> | ||
<p>This is the footer</p> | ||
<p>Global var: {{GLOBAL}}</p> | ||
<!-- END foot --> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
//error_reporting(E_ALL); | ||
//ini_set('display_errors', 'on'); | ||
//header("content-type: text/plain"); | ||
require('../TemplateObject.php'); | ||
|
||
$to = TemplateObject::loadTemplate('global.html'); | ||
|
||
$to->setBlock('head'); | ||
|
||
$to->setVariable('TITLE', "this is a 'title'"); | ||
$to->setGlobalVariable('GLOBAL', "this is a GLOBAL variable"); | ||
|
||
$to->setBlock('foot'); | ||
|
||
$b = $to->setBlock('content'); | ||
for($i = 1; $i <= 3; $i++) { | ||
$r = $b->setBlock('row'); | ||
$r->setVariable('COL', $i); | ||
} | ||
|
||
$to->showOutput(); | ||
?> |