mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-03 05:41:37 +01:00
update documenation, bug fixes
This commit is contained in:
@@ -15,6 +15,10 @@ fix_vars.php *.tpl' Be sure you have proper write permission, and backup your
|
||||
scripts first to be safe! The examples in the 1.4.0 documentation have been
|
||||
updated to reflect the changes.
|
||||
|
||||
cd /path/to/templates
|
||||
cp /path/to/fix_vars.php .
|
||||
find . -name "*.tpl" -exec php -q ./fix_vars.php {} \;
|
||||
|
||||
NEW AND IMPROVED COMPILER
|
||||
|
||||
Smarty 1.4.0 also has a new compilation process. Instead of compiling all the
|
||||
@@ -42,25 +46,25 @@ etc. Just give some formats a try and see what works.
|
||||
|
||||
Smarty now has template filters, meaning that you can run your templates
|
||||
through custom functions before they are compiled. This is good for things like
|
||||
removing unwanted comments, "beautifiying" your template code, keep an eye on
|
||||
removing unwanted comments, "beautifying" your template code, keep an eye on
|
||||
words or functionality people are putting in templates, translating XML ->
|
||||
HTML, etc. See the register_filter documentation for more info.
|
||||
|
||||
The format of the files created in the $compile_dir are now a bit different.
|
||||
Instead of reflecting the name and path of the source template, it uses an
|
||||
encoded file name, all in the top level directory. This was done to make way
|
||||
for arbitrary template resources. Each compiled template has a header that
|
||||
states what template resource was used to create it. From a unix command
|
||||
prompt, you can use "head -2 *" to see the first two lines of each file.
|
||||
|
||||
UPGRADE NOTES
|
||||
|
||||
When upgrading to 1.4.0, you will want to first clear out all your files in the
|
||||
$compile_dir, since it now uses a new format. If you have $compile_check set to
|
||||
false and the compiled template does not yet exist, it will compile it
|
||||
regardless of this setting. This way you can clear out the $compile_dir and not
|
||||
worry about setting $compile_check to true to get the inital compilation under
|
||||
way.
|
||||
The format of the files created in the $compile_dir are now a bit different.
|
||||
The compiled template filename is the template resource name url-encoded.
|
||||
Therefore, all compiled files are now in the top directory of $compile_dir.
|
||||
This was done to make way for arbitrary template resources. Each compiled
|
||||
template has a header that states what template resource was used to create it.
|
||||
From a unix command prompt, you can use "head -2 *" to see the first two lines
|
||||
of each file.
|
||||
|
||||
When upgrading to 1.4.0, you will want to clear out all your old files in the
|
||||
$compile_dir. If you have $compile_check set to false and the compiled template
|
||||
does not yet exist, it will compile it regardless of this setting. This way you
|
||||
can clear out the $compile_dir and not worry about setting $compile_check to
|
||||
true to get the inital compilation under way.
|
||||
|
||||
1.3.2
|
||||
-----
|
||||
|
||||
Reference in New Issue
Block a user