1 First, create a template object:
5 Then, load a template file (note: this can be done after you put the values in)
7 $tem->load('template.html');
10 <head><title>~title html~</title></head>
12 <th>Letter</th><th>Is For</th>
13 <!--~alphabet_table {~-->
14 <td>~letter html~</td><td>~is_for html~</td>
16 </table></body></html>""");
18 Then give it some data:
20 $tem->set('title', 'Example Template Output');
21 $tem->set('alphabet_table', array(
22 array('letter' => 'A', 'is_for' => '<A>pple'),
23 array('letter' => 'B', 'is_for' => '<B>anana')));
25 Then you can get/print the output:
29 And you should see this:
31 <head><title>Example Template Output</title></head>
33 <th>Letter</th><th>Is For</th>
34 <td>A</td><td>>A<pple</td>
35 <td>B</td><td>>B<anana</td>
36 </table></body></html>