X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=doc%2Ftemplate.php.txt;h=53186f935fa3e61fb1a82cbc845939d4dc418e98;hb=fa58a263a1ae73c2759648d033000a9a27f04cde;hp=416b6ac2d650ce0ef3ae6e97093119d1cf5e9001;hpb=96fa997ecdcd1e7a6cb27c61969a1c3ce6c648f8;p=wfpl.git diff --git a/doc/template.php.txt b/doc/template.php.txt index 416b6ac..53186f9 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~ | + +
---|