|
| 1 | +$HeadURL: https://xtpl.svn.sourceforge.net/svnroot/xtpl/trunk/README.txt $ |
| 2 | +$Id: README.txt 16 2007-01-11 03:02:49Z cocomp $ |
| 3 | + |
| 4 | + Welcome to XTemplate: a templating engine for PHP. |
| 5 | + http://www.phpxtemplate.org/ |
| 6 | + |
| 7 | +Purpose: |
| 8 | + |
| 9 | + - To enable the abstraction of PHP code logic from the display layer (HTML |
| 10 | + etc). |
| 11 | + Or: |
| 12 | + - To enable coders to do what they do best, code and designers to |
| 13 | + concentrate on their forte, presentation. |
| 14 | + |
| 15 | +Features: |
| 16 | + |
| 17 | + - Simple variable interpolation ( {STUFF} ) |
| 18 | + |
| 19 | + - Array variable interpolation |
| 20 | + e.g. {ROW.ID} {ROW.NAME} {ROW.WHATEVER}, you assign an array to the |
| 21 | + variable ROW once |
| 22 | + |
| 23 | + - Global PHP variables available without making assigns |
| 24 | + e.g. {PHP._SERVER.HTTP_HOST} {PHP._SERVER.PHP_SELF} or any variable: |
| 25 | + {PHP._COOKIE.PHPSESSID} |
| 26 | + |
| 27 | + - Assign using arrays |
| 28 | + e.g. $xtpl->assign(array('STUFF' => 'kewlstuff', 'ROW' => $row)); |
| 29 | + |
| 30 | + - Default nullstring for unassigned variables and unparsed blocks, |
| 31 | + custom nullstring for every variable or block |
| 32 | + |
| 33 | + - Dynamic blocks: |
| 34 | + - Multiple level dynamic blocks (nested blocks) |
| 35 | + - Autoreset feature (do not reset subblocks when reparsing parent |
| 36 | + block) |
| 37 | + - Recursive parse to parse all subblocks of a block |
| 38 | + |
| 39 | + - File (template) include: {FILE "another.template.xtpl"}, the included |
| 40 | + - templates can also contain includes recursively.. |
| 41 | + - uses fopen so you can include http:// and ftp:// files too |
| 42 | + |
| 43 | + - {FILE {VAR}} - you can assign filenames on the fly for {VAR} |
| 44 | + |
| 45 | + - On big projects you have the ability to substitute files with some other |
| 46 | + templates |
| 47 | + |
| 48 | + - Very simple and powerful syntax, you'll love it :) |
| 49 | + |
| 50 | +Documentation: |
| 51 | + |
| 52 | + For first time documentation, see the included example files (ex1.php - |
| 53 | + ex7.php) and their associated templates (*.xtpl) |
| 54 | + (cranx tried to write them so even newbies should understand easily) |
| 55 | + |
| 56 | + You should also find a docs folder with this distribution containing |
| 57 | + phpDocumentor (http://www.phpdoc.org) output. |
| 58 | + |
| 59 | + Other documenation can be found at http://www.phpxtemplate.org/ |
| 60 | + |
| 61 | +Installation: |
| 62 | + |
| 63 | + Nice and straight forward, just have upload it and include it - that's it! |
| 64 | + |
| 65 | +Upgrade: |
| 66 | + |
| 67 | + (stating the obvious - but some people seem to forget!) |
| 68 | + |
| 69 | + As with any software evaluate the upgraded version on some test code before |
| 70 | + deployment, then backup the previous version - in case there's any |
| 71 | + problems, then copy the new version over the old. Test, rollback to your |
| 72 | + backup (you did make a backup didn't you?!?) version if there's an issue, |
| 73 | + check the bug list and report if it's a new bug you've discovered. |
| 74 | + |
| 75 | +History: |
| 76 | + |
| 77 | +The code is very short and very optimized, according to my speed tests it's the |
| 78 | +fastest template engine around which can do nested blocks and variables.. |
| 79 | + |
| 80 | +The basic syntax is from FastTemplate and QuickTemplate |
| 81 | +(http://phpclasses.upperdesign.com/browse.html/package/49), but the entire |
| 82 | +class was written by cranx from scratch in one day, without a line from other |
| 83 | +template engines. THIS IS NOT A REWRITE OF OTHER ENGINES! |
| 84 | + |
| 85 | +The algorithm used makes this code amazing fast, you can do a bunch of |
| 86 | +nested dynamic blocks and everything you want, because it doesn't use recursive |
| 87 | +calls to build up the block tree. |
| 88 | + |
| 89 | +Docs and some functions we didn't need (clearing variables, etc) are still |
| 90 | +missing, but they'll come if there's demand. |
| 91 | + |
| 92 | +Sometime around 2002, cranx was too busy to continue with the project, so |
| 93 | +cocomp took over (kind of!), cocomp was then too busy for about, erm, 3 years! |
| 94 | +Anyway, cocomp has found a new lease of life for the project and rolled up the |
| 95 | +last few years improvements and released them on Sourceforge. Enjoy. If you |
| 96 | +want to get involved in XTemplate, see http://www.phpxtemplate.org/ |
| 97 | + |
| 98 | +Latest stable & Subversion versions always available @ |
| 99 | +http://sourceforge.net/projects/xtpl/ |
| 100 | + |
| 101 | +Copyright (c) 2000-2001 Barnabas Debreceni [ [email protected]] |
| 102 | +Copyright (c) 2002-2007 Jeremy Coates [ [email protected]] |
| 103 | + |
| 104 | +Licensed BSD / LGPL - see license.txt |
| 105 | + |
| 106 | +-- |
| 107 | +END |
0 commit comments