X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=test%2Ftem_test.php;h=18e467fbf87004463855d646ef993d798781e1ad;hb=900e09b8300463e3dd42e89c21de181520513e95;hp=2a8ef270a450ffad82b84ef923bfa66d47c31d07;hpb=e057305351d93155bf9f0d2c664b6eb859d83bf4;p=wfpl.git diff --git a/test/tem_test.php b/test/tem_test.php index 2a8ef27..18e467f 100644 --- a/test/tem_test.php +++ b/test/tem_test.php @@ -1,78 +1,79 @@ "'); + tem_set('bar', 'one*&^@$<>"'); + + # Now run the row. This runs the sub-template for the row, and appends the data + # for the 'foobar_row' entry in the main key/value list. + tem_sub('foobar_row'); + + # and a couple more times: + tem_set('foo', '"""""****"""""'); + tem_set('bar', 'two*&^"'); + tem_sub('foobar_row'); + tem_set('foo', '<<<<<<&&&&&&&&>>>>>'); + tem_set('bar', 'threeeeeeee*&^@$<>"eeeeeeeeeeee'); + tem_sub('foobar_row'); + + # Now we have a 'foobar_row' in the main keyval array with three rows of html in it. + + # in the template foobar_row is within a bigger sub-template called + # 'foobar_table'. The only reason for this is so that we can have that table + # not display at all when we're displaying the login. This is a silly use of + # the templates, but I wanted to demonstrate and test a simple use of a + # sub-template within a sub-template. + tem_sub('foobar_table'); + + + # Now run the main template (the body of the template file) tem_output(); - - exit(0); } -# Below is an example of using a sub-sub-template many times - -# first set some values to be displayed in the row: -tem_set('foo', '*&^@$<>"'); -tem_set('bar', 'one*&^@$<>"'); - -# Now run the row. This runs the sub-template for the row, and appends the data -# for the 'foobar_row' entry in the main key/value list. -tem_sub('foobar_row'); - -# and a couple more times: -tem_set('foo', '"""""****"""""'); -tem_set('bar', 'two*&^"'); -tem_sub('foobar_row'); -tem_set('foo', '<<<<<<&&&&&&&&>>>>>'); -tem_set('bar', 'threeeeeeee*&^@$<>"eeeeeeeeeeee'); -tem_sub('foobar_row'); - -# Now we have a 'foobar_row' in the main keyval array with three rows of html in it. - -# in the template foobar_row is within a bigger sub-template called -# 'foobar_table'. The only reason for this is so that we can have that table -# not display at all when we're displaying the login. This is a silly use of -# the templates, but I wanted to demonstrate and test a simple use of a -# sub-template within a sub-template. -tem_sub('foobar_table'); - - -# Now run the main template (the body of the template file) -tem_output(); - - -?> +# if this file were in a wfpl site proper, this would get called automatically, +# but this is here so you can run it directly from the examples dircectory: +tem_test_main();