From 7976e25b7adc79ed7db55a0eeaa2c8c2a3b0f4ad Mon Sep 17 00:00:00 2001 From: mohrt Date: Thu, 1 Feb 2001 20:08:04 +0000 Subject: [PATCH] update .che to .cache --- FAQ | 3 --- Smarty.class.php | 2 +- docs.sgml | 36 +++++++++++++++++++++++------------- libs/Smarty.class.php | 2 +- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/FAQ b/FAQ index 57d8f88e..17c73a34 100644 --- a/FAQ +++ b/FAQ @@ -68,9 +68,6 @@ Q: Smarty doesn't work. A: You must be using PHP 4.0.4pl1 or later to fix all known problems Smarty has with PHP. Read the BUGS file for more info. -Q: Smarty is recompiling my templates on every invocation. -A: This is a bug that was fixed in 1.0a, grab the latest tarball. - Q: I get the following error when running Smarty: Warning: Wrong parameter count for preg_replace() in Smarty.class.php on line 371 diff --git a/Smarty.class.php b/Smarty.class.php index 6a6fb2f6..caf670de 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -266,7 +266,7 @@ class Smarty while($curr_file = readdir($this->cache_dir)) { if ($curr_file == '.' || $curr_file == '..') continue; - if(substr($curr_file,-4) == '.che') + if(substr($curr_file,-4) == '.cache') unlink($curr_file); } } diff --git a/docs.sgml b/docs.sgml index d97e83af..c8adabd7 100644 --- a/docs.sgml +++ b/docs.sgml @@ -115,8 +115,8 @@ It is possible to embed PHP code right in your template files, although this may not be needed (nor recommended) since the engine is so customizable. - Built-in caching support (new in 1.3.0) + How Smarty works @@ -888,8 +888,7 @@ Intro = """This is a value that spans more run into the situation where it is impossible to pass data to a template before the template is executed because there is info in the template needed to aquire the data, kind of a catch 22. The insert tag is a way - to callback a function in PHP during runtime of the template. (This is much - like the functionality of Server Side Includes in a static html page.) + to callback a function in PHP during runtime of the template. Let's say you have a template with a banner slot at the top of the page. The @@ -922,21 +921,26 @@ Intro = """This is a value that spans more and display the returned results in place of the insert tag. - A note on caching: If you have caching turned on, insert tags will - not be cached. They will run dynamically every time the page is - created. This works good for things like banners, polls, live - weather, user feedback areas, etc. + A note on caching: If you have caching turned on, insert tags + will not be cached. They will run dynamically every time the page + is created, even within cached pages. This works good for things + like banners, polls, live weather, search results, user feedback + areas, etc. if,elseif,else - if statements in Smarty have much the same flexibility as php if statements, - with a few added features for the template engine. - Every if must be paired with /if. else and elseif are also permitted. - "eq", "ne","neq", "gt", "lt", "lte", "le", "gte" "ge","is even","is odd", - "is not even","is not odd","not","mod","div by","even by","odd by","==","!=",">", - "<","<=",">=" are all valid conditional qualifiers. + if statements in Smarty have much the same flexibility as php if + statements, with a few added features for the template engine. + Every if must be paired with an + /if. else and + elseif are also permitted. "eq", "ne","neq", + "gt", "lt", "lte", "le", "gte" "ge","is even","is odd", "is not + even","is not odd","not","mod","div by","even by","odd + by","==","!=",">", "<","<=",">=" are all valid conditional + qualifiers. if statements @@ -955,6 +959,12 @@ Intro = """This is a value that spans more ... {/if} +{* same as above *} +{if $name == "Fred" || $name == "Wilma"} + ... +{/if} + + {* parenthesis are allowed *} {if ( $amount < 0 or $amount > 1000 ) and $volume >= #minVolAmt#} ... diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 6a6fb2f6..caf670de 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -266,7 +266,7 @@ class Smarty while($curr_file = readdir($this->cache_dir)) { if ($curr_file == '.' || $curr_file == '..') continue; - if(substr($curr_file,-4) == '.che') + if(substr($curr_file,-4) == '.cache') unlink($curr_file); } }