PHP Fast Template - Assigning variables to FastTemplate objects
(Page 3 of 6 )
Within the PHP script, variables will eventually need assigned to the FastTemplate instance. Here is the syntax for doing this:
$tpl->assign("HOUSE", $House);
Now the FastTemplate object contains the data found in the
variable, "$House"
Parsing TemplatesParsing the FastTemplate instance remains the final bit of processing that takes place in order to see results. These lines accomplish that task.
$tpl->parse(MAIN, "index_tpl");
$tpl->FastPrint();
"MAIN" in the above code represents the top level HTML
template. Sometimes many HTML templates are parsed and each one will be represented with a distinct name. "MAIN" refers to the parent HTML template. The final command calls the FastPrint function which delivers the final product, a beautiful dynamic HTML page, to the computer screen.
Next: MySQL Data parsed through FastTemplates >>
More PHP Articles
More By Ian Felton