| Example 1 | |
|---|---|
This is a very simple example to demonstrate the basic setup.
Program File
#1: <?php
HTML template file
# 0: <?
So, what does it do here?
First we load the Parser file: require_once("./stp.inc");
Now we create a new instance of the parser2 class:
$STP = new parser2;Next we set the parameter "HELLO" with the value "Hello World": $STP->setParam("HELLO","Hello World");
Now we tell the parser where to find the template to use for the output:
$STP->setTemplate("example1.tmpl");
Finally, the parser is told to print out the result:
$STP->parseAndEcho();In our template file example.tmpl the parser will now find the tag . It will then check if it has a parameter by this name and if so replace it. See the result Important: If the parser does not find a parameter that matches a given tag this tag will be stripped. |
| .GR - Domains for you |
No residence restrictions - anybody can register
Registration starting at € 16,33 / year
Web Hosting incl. .gr-Domain from € 8,90 / month
|