X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=doc%2Ftemplate.php.txt;h=6a6431949ec2231a2b642f66d50d7234bc626210;hb=5c6801b4d9a3c68f7fd2601b6446ce1f1160bd2d;hp=416b6ac2d650ce0ef3ae6e97093119d1cf5e9001;hpb=96fa997ecdcd1e7a6cb27c61969a1c3ce6c648f8;p=wfpl.git diff --git a/doc/template.php.txt b/doc/template.php.txt index 416b6ac..6a64319 100644 --- a/doc/template.php.txt +++ b/doc/template.php.txt @@ -1,39 +1,36 @@ - First you have some globally accessible array of key->value pairs which contain the data to be entered into templates +First, create a template object: - Then you have some template files + $tem = new Tem(); -tem_set($key, $value) -tem_get($key) -tem_run($file/template) -tem_echo($file/template) { echo tem_run($file); } +Then, load a template file (note: this can be done after you put the values in) -This should work for simple templates such as: foo: '~foo~' + $tem->load('template.html'); + # or + $tem->load_str(""" +
Letter | Is For | + +~letter html~ | ~is_for html~ | + +
---|