Template Lite - the faster compiling PHP template engine
What is Template Lite?
Template Lite has many advantages over other template engines, as well as a few disadvantages.
- Template Lite is a stripped down version of Smarty and thus is extremely fast, yet very similar to Smarty.
- Template Lite uses most of the same basic syntax as Smarty template engine, making it relatively easy to port template files from Smarty and for previous users of Smarty to quickly learn how to use it.
- Template Lite variable syntax, specifically variables in double quotes and concatentation, is designed to imitate PHP's, making variable usage intuitive for beginners who are used to programming in PHP.
- Template Lite introduces the new
switch
and for
tags, which have identical functionality to PHP's switch
and for
functions, respectively.
- Template Lite compiles all template files for speed, making script start-up faster. All compiled files are saved for faster loading on the next load.
- Template Lite will also optionally save a cached version of templates, thus bypassing any compiling or execution, as it will load static pages precompiled and assembled, offering significant speed increases.
- Template Lite supports config files and variables and will compile config files for speed, too!
Template Lite was designed from the ground up to be fast. It has acheived that goal.
What you see here is the work of Paul Lockaby. However, while more than 75% of the code in this template engine has been rewritten, a bunch of that other 25% and a lot of organization has been directly derived from Smarty - the compiling PHP template engine for PHP. Smarty template engine was originally programmed and is still maintained at the aforementioned website by Monte Ohrt and Andrei Zmievski.
All updates, fixes and changes beginning February 1, 2006 are by Mark Dickenson when the project was taken over after being abandoned by Paul Lockaby due to a trademarking issue with the creators of Smarty.
At the moment I know of no bugs. Usually when I find one, I squash it as soon as possible. Let me know if you find one and I'll fix it, too.
When creating Custom blocks, functions, modifiers and filters there is only one change you need to make to files. The function name needs to be changed slightly.
- function smarty_modifier_cat() { // Smarty
Should be changed to
- function tpl_modifier_cat() { // Template Lite
The name smarty in the function name needs to be changed to tpl.
When extending the template class you will need to use a different class name.
- class {your class name} extends Smarty { // Smarty
Should be changed to
- class {your class name} extends Template_Lite { // Template Lite
The name Smarty in the class name needs to be changed to Template_Lite.
When extending the template compiler class you will need to use a different class name.
- class {your class name} extends Smarty_Compiler { // Smarty
Should be changed to
- class {your class name} extends Template_Lite_Compiler { // Template Lite
The name Smarty_Compiler in the class name needs to be changed to Template_Lite_Compiler.
The reason for these changes is because of Trademarking issues with Smarty. The authors of Smarty have trademarked the name and it can no longer be used in variable, function and class names in this package.
Template Lite offers most of the features of Smarty but there are a number of features that are currently not supported. Some of these features will eventually be supported in later releases. This isn't a comprehensive list of unsupported features.
- Template Lite does not support the
include_php
tag, security features, and error handling.
- The following reserved variables are not supported:
foreach
. Example: {$templatelite.foreach.[something]}
- Template Class Variables:
$debug_tpl
, $debugging_ctrl
, $autoload_filters
, $compile_check
, $cache_handler_func
,
$cache_modified_check
, $security
,
$secure_dir
,
$security_settings
,
$trusted_dir
, $compiler_class
,
$request_vars_order
,
$request_use_auto_globals
,
$error_reporting
,
$compile_id
,
$use_sub_dirs
,
$default_resource_type
- Template Class Functions:
get_registered_object
, register_object
and unregister_object
These are things that I should have done before I released it, but that I put off to do until after I released the code.
- Comments inside of comments do not get parsed properly. (ex:
{* a comment {* another comment *} *}
will be displayed as *}
)
- January 4, 2007 - Version 2.10
- Moved the template core functions _build_dir, _destroy_dir and _rmdir from within the template class to the internal directory. The program code will only be loaded if a template requires them.
- Added register_resource and unregister_resource support. Different resources are supported by everything except for cached template output.
- Added _get_resource internal function for processing file: and absolute tag resources.
- Added resize_image plugin.
- Fixed support for absolute paths to template files. Absolute pathing wasn't functioning properly and only halfway worked in the {include} tag. Absolute pathing should work with the {include} tag, fetch method and display method. The optional use of the file: designator was added.
- Fixed Undefined variable: notices in function.mailto.php.
- Fixed return by reference error in class.template.php when using the get_template_vars and get_config_vars methods.
- Fixed append method at line 199 in class.template.php. If the merge flag was set arrays would not be merged properly because of the wrong variable element name.
- Changed compiled page HTML comment to a PHP comment to prevent UTF-8 failures from occuring.
- Re-added showheaderinfo prefilter plugin.
- December 17, 2006 - Version 2.00
- Removed the following variable modifier plugins (array_reverse, count, nl2br, number_format, strip_tags, ucfirst, ucwords, urlencode and wordwrap) the template engine will use the PHP functions instead of using a plugin file.
- Removed showheaderinfo prefilter plugin and included it into the main compiler.
- Added jstrip prefilter.
- Added support absolute paths to template files.
- Added version date checking for compiled template files. When a new version of Template Lite is installed the compiled date is compared to the version date of Template Lite and if the compiled date is OLDER than the Template Lite version date the template will be recompiled. This will prevent incompatible compiled template files from showing possible errors when Template Lite is upgraded.
- Added support for the usage of PHP functions as variable modifiers
- Added IS expression to the IF tag. It supports all of the normal IS expressions from Smarty.
- Changed php function. If the PHP tag is use with the php_extract_vars enabled the _vars array will be extracted to non-array variables for EACH PHP tag block. If the template is compiled on PHP 4.3.0 or higher the variables will be extracted by reference. Any changes in the extracted variables will be reflected in the array variables they were extracted from.
- Moved the compiler core functions _compile_config, _compile_custom_block and _compile_custom_function from within the compiler to the internal directory. The program code will only be loaded if a template requires them.
- Fixed function.html_options.php changed $_value to $_val in line 40. Thanks to Michael Klein michael_633@users.sourceforge.net for the fix.
- Fixed undefined offset error at line 667 in class.compiler.php when in strict error reporting mode.
- September 1, 2006 - Version 1.90
- Added while function. This function is almost idential to the PHP while function.
- Added db_function_call will allow execution of an ADOdb Lite function from within a template.
- Added db_result_call will allow execution of an ADOdb Lite result set function within a template.
- Added in_array will test data in an array and return a set value if a match is found.
- Fixed Notice Use of undefined constant error in function_exists statement in compiler class at include and section_start tags.
- Fixed Notice: Undefined offset: 0 error in fetch_compile_include template function.
- Fixed Notice: Use of undefined constant error in compile.section_start.php file.
- Fixed array_shift(): The argument should be an array error in class.compiler.php file when trying to reference CONST variables.
- Fixed IF floating point number parsing error in class.compiler.php file when an IF like {if $test == 1.5} is processed in a template. The 1.5 would be returned as 1 .5 causing the if to fail.
- April 23, 2006 - Version 1.80
- Moved gzip variables from global status to public object variables.
- Added const reserved variable {$templatelite.const.[something]}.
- Added TEMPLATE_LITE_DIR constant variable for referencing directory path to class files.
- Added variable list support in {include} function.
- Added debug support for templates included with the {include} function.
- Fixed %section% variable usage in {if} and {math} functions.
- Fixed backticks around variables inside double quotes in a template file not being removed when the variable was being processed.
- Fixed debug console was not displaying include files and indenting.
- Fixed some variables inside quotes not being processed as variables if they are the FIRST item right beside the quote. Example: "$variable" not processed but " $variable" is processed
- April 15, 2006 - Version 1.70
- Added html_hidden function.
- Added debug compiler function. This is the same as the debug function in Smarty only it is a compiler function in Template Lite.
- Added debug console output when debugging enabled.
- Added $debugging programming variable.
- Added support for section property syntax {%sectionname.varname%} used before Smarty 1.5.0.
- Added $default_modifiers programming variable.
- Added register_compiler_function function.
- Added unregister_compiler_function function.
- Added support for custom compiler functions.
- Changed plugin_dir variable name to plugins_dir to maintain compatibility with Smarty.
- Added support for multiple plugin directories.
- Moved all count() functions outside all for loops in the compiler and template engine to improve speed.
- Moved all _escape_chars() from class.template.php to a shared plugin (shared.escape_chars.php) because it is only used by other custom plugins.
- April 12, 2006 - Version 1.60.1
- Fixed section function error "Fatal error: Using $this when not in object context in compile.section_start.php on line 11"
- April 11, 2006 - Version 1.60
- Added template reserved variable {$templatelite.template}.
- Added section reserved variable {$templatelite.section.[something]}.
- Added config reserved variable {$templatelite.config.[something]}.
- Added version reserved variable {$templatelite.version}.
- Added rdelim reserved variable {$templatelite.rdelim}.
- Added ldelim reserved variable {$templatelite.ldelim}.
- Added section/sectionelse function.
- Added clear_all_cache method.
- Added append method.
- Added append_by_ref method.
- Moved config_load code to a dynamically loaded internal program module called template.config_load.php in the internal directory.
- Changed html_checkbox custom function name to html_checkboxes to maintain compatibility with Smarty.
- Changed html_radio custom function name to html_radios to maintain compatibility with Smarty.
- Changed left_tag variable name to left_delimiter to maintain compatibility with Smarty.
- Changed right_tag variable name to right_delimiter to maintain compatibility with Smarty.
- Changed clear_compiled method name to clear_compiled_tpl to maintain compatibility with Smarty.
- Changed get_vars method name to get_template_vars to maintain compatibility with Smarty.
- Changed clear_cached method name to clear_cache to maintain compatibility with Smarty.
- April 8, 2006 - Version 1.50
- Added array_reverse modifier.
- Added reserved_template_varname configuration variable. This variable can be changed from templatelite to smarty. This will allow any of your templates that use the $smarty reserved template variable to work without editing.
- Added name argument to capture block.
- Changed $_TPL reserved variable to $templatelite. This variable is used in the same manner as the $smarty reserved variable.
- Fixed date modifier
- Fixed date_format modifier
- Fixed html_select_time function
- Fixed html_select_date function
- Fixed make_timestamp shared function
- April 6, 2006 - Version 1.40
- Added clear_all_assign class method.
- Added assign_by_ref class method.
- Renamed clear class method to clear_assign for compatibility.
- Changed variable array usage inside template files to use periods (.) between the array elements in addition to the normal brackets. Example: { $foo[0] } and { $foo.2 } both work.
- Changed assign function name argument to var for compatibility.
- Fixed Call-time pass-by reference errors.
- Fixed prefilter.showinfoheader.php error with <?php tag.
- Fixed postfilter.showtemplatevars.php error with <?php tag.
- Fixed pre/post load_filter functions
- Fixed pre/post register functions
- April 2, 2006 - Version 1.30
- Added textformat block.
- Added html_select_date function.
- Added html_select_time function.
- Added html_table function.
- Added mailto function.
- Added math function.
- Added popup function.
- Added popup_init function.
- Added make_timestamp shared function.
- Updated and expanded documentation files.
- March 28, 2006 - Version 1.20
- Fixed: Plugin array elements were not predefined and were giving NOTICE errors when accessed.
- Fixed: gzip output filter was referencing the wrong variable for detecting caching.
- Added date_format modifier.
- Added spacify modifier.
- Added regex_replace modifier.
- Added indent modifier.
- Added escape modifier.
- Added cat modifier.
- Added count_words modifier.
- Added count_sentences modifier.
- Added count_paragraphs modifier.
- Added count_characters modifier.
- March 26, 2006 - Version 1.10
- Added pre and post filters to load_filter function to allow loading of pre/post filters similar to Smarty pre/post filters.
- Added auto loading function to compiler for pre and post filters.
- Added register_prefilter function to allow registering pre filters.
- Added unregister_prefilter function to allow removing registered pre filters.
- Added register_postfilter function to allow registering post filters.
- Added unregister_postfilter function to allow removing registered post filters.
- Added register_outputfilter function to allow registering output filters.
- Added unregister_outputfilter function to allow removing registered output filters.
- Added showtemplatevars post filter.
- Added showinfoheader pre filter.
- February 1, 2006 - Version 1.00
- Forked from Smarty-Lite and changed version number and name.
- Fixed a bug in clear that prevented it from clearing properly.
- Changed the PHP tag to automatically import all template variables into the PHP workspace if $tpl->php_extract_vars is set to true.
- Added flag ($tpl->encode_file_name) to allow disabling of encoding the template output filename. If disabled the template filename will be the full path to the template file and the template filename.
- Added load_filter function to allow loading of output filters similar to Smarty output filters.
- Added gzip output filter.
- October 10, 2005 - Version 2.2.11
- Updated all of the plugins to follow a more standard code base and to properly escape strings before being passed to the template. (Thanks to Ara Anjargolian and Michael Klein.)
- Fixed a bug in _rm_dir that prevented it from removing non-cache groups and compiled pages correctly.
- Fixed a bug in _get_plugin_dir that referred to a hardcoded directory separator. (Thanks to Michael Klein.)
- Fixed a warning in _build_dir. (Thanks to Michael Klein.)
- Fixed a bug where error level reporting was being returned to normal prematurely. (Thanks to Axel.)
- Changed the required stack from a numerical array to an associative array to avoid using array_unique in order to remove duplicate plugins from the list. (Thanks to Axel.)
- Fixed a typo in _parse_function that would throw errors in some situations.
- August 7th, 2005 - Version 2.2.10
- Updated documentation to fix errors in the documentation for count. (Thanks to Georg Gretz.)
- Fixed a bug in _is_cached that would result in an error if cache groups were to be used. (Thanks to Hahl Laszlo and Michael Klein.)
- Removed the 777 umask from the cache group builder. Folders created in the cache directory to represent cache groups will now use the same permissions as the parent directory.
- Added the php tag to the compiler to allow for putting PHP directly into the template. To get to the variables assigned to the template, you can use the get_vars function to get variables from the PHP code. (Thanks to "Panama Jack".)
- June 29, 2005 - Version 2.2.9
- Fixed a bug in class.compile.php where assign didn't work. (Thanks to Georg Gretz.)
- Updated documentation to actually refer to the count modifier.
- Changed bbcode2html so that it uses <pre> to surround blocks of code.
- February 26, 2005 - Version 2.2.8
- Changed the newline in each file back from \r\n to just \n, thus saving a few bytes and making it more "Unix"-like.
- Fixed a bug where modifiers that didn't exist but began with a number ended up being concatenated to the end of the variable they were modifying.
- Fixed bug in if-then statements where variables with a number in them were parsed incorrectly.
- Fixed any known variable problems involving numbers in the variable name.
- February 14, 2005 - Version 2.2.7
- Fixed a bug that fell into the place somewhere along the line that caused modifiers with digits in them to be parsed incorrectly.
- Added html_hidden plugin.
- December 11, 2004 - Version 2.2.6
- Fixed a bug where variables of 1 character were being misinterpreted as function calls and thus throwing errors when the function was not found. (Thanks to Ara Anjargolian.)
- Added more special cases to if-then statements to accomodate for errors introduced in 2.2.5 and 2.2.4 with the template function changes. Specifically, the changes were adding the case-insensitive values "true", "false" and "null". (Thanks to Ara Anjargolian.)
- October 30, 2004 - Version 2.2.5
- Fixed a typo in the for function that resulted in the stop condition being changed if the step condition was not present.
- Fixed a typo in the switch function that resulted in it not working at all. (Thanks to user ximian on the Yellow Duck forums.)
- Template functions will not work in if-then statements. Almost all PHP functions will. Those that pass the function_exists test will, as well as empty, isset, and unset.
- October 15, 2004 - Version 2.2.4
- Modifiers can now be placed on variables in if-then statements, but functions in if-then statements will now throw an error as they should not be used in this context. (Thanks to Jacquot Frederic.)
- Added the values/output variables to html_options, as per the Smarty implementation of the same plugin. (Thanks to Ara Anjargolian.)
- Fixed a bug in for that prevented the use of variables when assigning a starting and stopping point. (Thanks to Tim Green.)
- Updated the template code to use the more compatible <?php instead of <?. (Thanks to Pieter Claerhout.)
- September 16, 2004 - Version 2.2.3
- Fixed an bug in the _is_cached function that would result in incorrect cache usage.
- Added the urlencode modifier to the standard distribution.
- August 3, 2004 - Version 2.2.2
- IT IS VERY IMPORTANT THAT YOU CLEAN OUT YOUR COMPILE AND CACHE DIRECTORIES AFTER THIS UPGRADE!
- Another error in _is_cached() is now resolved. (Thanks to Ara Anjargolian.)
- Compiled and cached template MD5s are now stored with the full template directory path in them to allow for storing templates in different template directories. (Thanks to Pieter Claerhout.)
- Compiled files are now prefixed with a 'c_' when saved to allow compiled and cached files to be stored in the same directory. (Thanks to Pieter Claerhout.)
- July 31, 2004 - Version 2.2.1
- IT IS VERY IMPORTANT THAT YOU CLEAN OUT YOUR COMPILE AND CACHE DIRECTORIES AFTER THIS UPGRADE!
- My attempt at making cache files check included files for changes failed previously. Now it works.
- July 31, 2004 - Version 2.2.0
- IT IS VERY IMPORTANT THAT YOU CLEAN OUT YOUR COMPILE AND CACHE DIRECTORIES AFTER THIS UPGRADE!
- If a file was cached and had
includes
and the includes changed, the cached file wouldn't change. Now if an included file changes the cache will be regenerated.
- IMPORTANT! Removed support for compile_ids. This is a big one as it changes the syntax of all calls to
display
and fetch
and requires regeneration of all existing template files. (Thanks to Ara Anjargolian.)
- Fixed a bug where in some cases, not having a trailing slash on your template directory name would result in an error when calling
is_cached
. (Thanks to Pieter Claerhout.)
- Empty templates no longer generate an error.
- PHP tags are now escaped so that you can create XML templates.
_get_dir
now correctly checks for a trailing slash using DIRECTORY_SEPARATOR instead of '/'. (Thanks to Pieter Claerhout.)
- July 18, 2004 - Version 2.1.2
- Fixed custom function parsing, which has apparently always been broken.
- Paths now work in Windows. Didn't work because of a quoting bug. Now use single quotes instead of double quotes.
- Can now pass an object method as a custom function/block/modifier.
- Removed "compiler functions" because I think they're a pain to maintain.
- July 14, 2004 - Version 2.1.1
- Fixed concatenation problems.
- Implemented a new 'count' modifier that when used with the '@' will return the number of elements in the array it modifies.
- Fixed plugin modifier routines to correctly map to arrays.
- February 7, 2004 - Version 2.1.0
- Really fixed the
in_array
bug in get_config_vars
this time. Honestly.
- Fixed a bug where if a modifier was missing it would not give the name of the modifier missing but instead give some crap. Thanks to Ryan Johnson for catching this one.
- Added the legacy option 'item' to
foreach
to make it more backwards compatible with Smarty.
- Fixed the broken functionality of
$force_compile
as a result of the 2.0.0 release. :(
- Fixed a bug in
class.config.php
that kept it from creating arrays if $config_overwrite
was enabled and made appropriate changes to class.template.php
to accomodate this change in the compilation step. This new fix requires PHP 4.2.0, however.
- Made it such that if you have an array of config variables you can actually refer to them in your template using a similar syntax to an array of variables. They syntax looks like this:
#foo[$bar]#
.
- Variables can no longer begin with an integer.
- The following syntaxes actually work.
$foo[$bar]
, $foo[#bar#]
, #foo[0]#
, #foo[$bar]#
, #foo[#bar#]#
. Note that you cannot have $foo[#bar[0]#]
or anything like that (i.e. an array in an array) because I don't think it can be done ad inifinitum. Anyone who thinks differently can submit some code.
- January 20, 2004 - Version 2.0.1
- Fixed a bug with
for
that would cause it to not work at all.
- Fixed a bug with
for
that required the step
option. Now step
defaults to '1'.
- Changed
in_array
in get_vars
and get_config_vars
to isset
because the former didn't seem to work, and I just noticed that.
- January 15, 2004 - Version 2.0.0
- Fixed major bug with
clear_compiled
that would cause the script to not remove all compiled templates.
- Added the following variables to be set by the user:
$cache
- if set to 'true', pages will be cached for speed.
$cache_dir
- where the cached files will be stored on the filesystem.
$cache_lifetime
- how old the cache can be before it gets flushed.
- Added the following functions for use by the user:
is_cached($file, $compile_id = null, $cache_id = null)
- will see if the specified file has a cached copy available.
clear_cached($file = null, $cache_id = null)
- will clear the cache for the specified file and cache id, or if neither are specified, the entire cache.
- Modified the following functions for use by the user:
display($file, $compile_id = null, $cache_id = null)
- now has the optional $cache_id
parameter.
fetch($file, $compile_id = null, $cache_id = null) - now has the optional $cache_id
parameter.
- Caching was added for templates. Cache lifetimes are specified by the user for each template. Cache lifetimes are also inherited from the calling template, so if you use an
include
, the included file will have the same cache lifetime as the calling template. The default cache lifetime is zero seconds, which is the same as not having a cache.
- Cache groups are handled in the same fashion as compile groups.
- Inserts are not be cached and are fetched with each invocation of a cached template. Required a change to the compiler that would check to see if the the page was being cached and then store the insert data different. So basically, to copy the template_lite people, I took an MD5 hash of 'template_lite' (or was it 'template_lite'... I can't remember) and surrounded the insert information in that and then replaced it using a built-in post-filter.
- Rewrote
_rm_dir
and _destroy_dir
and clear_compiled
code to be a little cleaner and better (and in some cases actually work).
- Removed "support" for running the installation without compilation. Support was spotty and I can't figure out why anyone would use it that way anyway.
- Rewrote
fetch
code to handle caching, added a _fetch_compiled
function, thus making it so that fetch
only receives the completely compiled code, not each individual template. Also required a change in the compiler to implement this change.
- Added a new
for
function that will loop through a block of code from start
to stop
, and skipping step
integers each time. Identical in functionality to PHP's for
loops in PHP. An optional value
argument will assign the current position of the foor loop to the variable specified (by way of value=var
).
- Fixed bug in compiler where a value of "0" was the same as an empty value.
- Fixed a bug in
foreach
error checking.
- Heavily modified the way
inserts
work in order to allow them to be non-cacheable.
- Fixed the
plugin_dir
retrieval so that it will work via relative or absolute paths. For instance, if your plugin directory is a sub-directory of your bin directory then it will recognize that, but if it is somewhere else, it will also recognize that.
- Fixed
config_load
compiling problems :\ where no quotes were put around strings and such.
- Fixed a spacing bug that would insert stupid newlines all over the place, where they didn't belong.
- Miscellaneous fixes and speed-ups here and there.
- Reorganized and wrote some new documentation, though a lot of it was gleaned from documentation for Smarty.
- Removed the
$display
parameter for fetch
and instead just made display
function echo the fetch return.
- December 14, 2003 - Version 1.1.16
- Added a boolean option into
html_checkbox
so that if you pass "true" or "yes" or "on" as the checked
value, it will be checked. Additionally, it will still be checked if value
is equal to checked
.
- Fixed a bug with
class.config.php
that would read commented variables in.
- Changed the method with which files are read in to use
file_get_contents
which is supposedly faster than using fread
.
- July 27, 2003 - Version 1.1.15
- Removed the
spacify
modifier from the distribution.
- Updated the docs some more. They are basically done now, but I may make changes later to update them.
- Included the docs with the distribution.
- Modified a bunch of the
html_*
functions to be more standards complian (i.e. quotes around attribute values).
- Modified
html_options
and removed the values and output attributes.
- July 25, 2003 - Version 1.1.14
- Made
html_textbox
be HTML 4.01 Strict compatible
- Fixed a bug in
class.config.php
that would mess up a config value if it contained a # (pound).
- July 17, 2003 - Version 1.1.13
- Fixed a bug with
elseif
.
- Fixed a bug with assigning variables using the
assign
operator.
- July 15, 2003 - Version 1.1.12
- Added
html_options
to plugins folder.
- July 14, 2003 - Version 1.1.11
- Fixed incredibly stupid and embarrasing bug in
_run_insert
that prevented inserts from working at all. Way to go me for not testing them...
- July 13, 2003 - Version 1.1.10
- Fixed bug where compilation would crash if the the template file was empty.
- Made it so that E_NOTICE errors will not come up during template execution.
- July 4, 2003 - Version 1.1.9
- Added functions
assign_config
and clear_config
to facilitate assigning configuration variables. I know that this defeats the purpose of configuration variables, but for my needs, I want it like this.
- Fixed stupid bug in the assigning of an array of values, also added check to not allow for numeric variable names.
- Fixed \$ bug in
foreach
compilation.
- July 3, 2003 - Version 1.1.8
- Modified
class.template.php
and class.compiler.php
to store the compile_id as a class variable.
- Forced compiled included templates to be saved in the same compile id folder as the template that included them.
- Fixed bug in
class.config.php
where it would read the first section in the file twice, once as the section name and once as the "globals" section. Fixed this by inserting a space at the beginning of the file after it is read into memory.
- This time I actually put all of the necessary files into the zip file to be released. I don't know what was up with that!
- July 2, 2003 - Version 1.1.7
- Fixed bug where an error come up on E_ALL because a variable wasn't initiated.
- June 22, 2003 - Version 1.1.6
- Changed the special _TPL vars from referencing $GLOBALS to referencing the $_ super-globals.
- Fixed
include
so that it stored the included files inside of the same subdirectory as the original file in the compile directory.
- Fixed the
_build_dir
code to not create any directories if compile = false
.
- Forced
clear_compiled
to exit without doing anything if compile = false
.
- Removed a debugging
echo
statement from _rm_dir
.
- Fixed bug in compilation and the compilation path of
config_load
.
- Finished some more plugins,
capture
, cycle
, counter
, and html_radio
.
- June 22, 2003 - Version 1.1.5
- Removed support in config files for single quotes around values. Can still use double quotes and keywords like true/false, yes/no, and on/off
- Changed modifiers back to the
tpl_
syntax so as to avoid confusion regarding any support for Smarty modifiers.
- Moved _syntax_error *back* to
class.template.php
and renamed it to 'trigger_error'
- Wrote a bunch of new and copied a bunch existing Smarty plugins to be included with the Template Lite distribution.
- Fixed multiple bugs with the modifier usage and plugin inclusion.
- Updated documentation to include a tiny bit more information on config files, functions, and modifiers. Documentation is still sparse.
- Took
config_load
and put it into class.compiler.php
instead of in the plugins folder.
- Wrote in three new functions to allow for compile groups to be made. Also will allow for cache groups to be made when the time comes.
- Moved the compile object into a class-variable instead of a function variable, to execution speed on multiple display/fetch calls.
- June 20, 2003 - Version 1.1.4
- Included a bunch of plugins with the distribution.
- Retracted claim of full support for Smarty plugins.
- Added support for config files, config vars and included the config_load function in
class.template.php
- June 18, 2003 - Version 1.1.3
- Changed plugin nomenclature to be entirely compatible with Smarty. This means that modifier, function, block, and compiler plugins written for Smarty can be used with Template Lite.
- Fixed a bug in _run_modifier and _parse_modifier.
- Added a _require_stack variable into the compiler so that files that need to be included will be included dynamically and automatically. This also puts more of the error-checking into class.compiler.php, that is when I begin writing error-checking routines.
- Added a regular expression into the compiler that will remove all unncessary opening and closing PHP tags.
- Fixed a bug in _compile_arguments
- Added 'force_compile' option (mostly for my testing :)
- June 17, 2003 - Version 1.1.2
- Fixed some embarrassing bugs in the template compiler regarding modifiers and missing functions.
- Made class compiler extend class template.
- Removed modifier specific references to the _plugin_exists function.
- Updated documentation to include some comments on variable modifiers.
- Allowed functions inside of IF-THEN statements.
- Added to the TODO list, perhaps someday I'll begin taking off of it, who knows.
- June 16, 2003 - Version 1.1.1
- Removed _syntax_error and _fatal_error from class.compiler.php
- When the script doesn't find the specified template file, it will just die and say the name of the file it couldn't find.
- Forced the compiler to check for the existence of plugins instead of the displayer (thus allowing me to remove _syntax_error from class.compiler.php).
- June 15, 2003 - Version 1.1.0
- Seperated the compiler from the displayer.
- Add option to save compiled files. This coupled with the compiler seperation gives me a two to three times speed increase.
- June 12, 2003 - Version 1.0.0
Home