| |
Quick start
Here I'll show you an simple example how
to build your first report.
First we write the PHP script
<?php
require_once('sptpl.php');
require_once('sptpl.inc');
require_once('sptpl_db.php');
$t=new sptpl();
$t->LoadTemplate('test1.xml');
$t->SetVar("name","George");
$bar['foo']='Index foo';
$t->SetVar("bar",$bar);
$t->run("test1.txt");
?>
|
Second step, write the configuration file test1.xml
<?xml version='1.0' ?>
<template>
<report>
<beginreport>Hi My First Test
</beginreport>
<row id='pippo'>
Hello world, my name is {$name}
</row>
<closereport>
End!That's all folk!
</closereport>
</report>
</template> |
|
|