From 77fa84916e042fe48b79b82be1bb159238988454 Mon Sep 17 00:00:00 2001 From: mohrt Date: Wed, 12 Feb 2003 22:13:18 +0000 Subject: [PATCH] fix bug with decimal numbers in if statements, misc doc updates --- NEWS | 2 +- Smarty_Compiler.class.php | 2 +- docs/designers.sgml | 30 ++++++++++++++++++------------ libs/Smarty_Compiler.class.php | 2 +- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/NEWS b/NEWS index 3729edae..635cf539 100644 --- a/NEWS +++ b/NEWS @@ -22,7 +22,7 @@ Version 2.4.0 (Feb 2, 2003) --------------------------- - fix known problems with php tag handling in templates - (recursion, echoing ' . $this->_obj_call_regexp . '(?:' . $this->_mod_regexp . '*) | # valid object call ' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*) | # var or quoted string - \-?\d+|!==|<=>|==|!=|<=|>=|\&\&|\|\||\(|\)|,|\!|\^|=|<|>|\||\%|\+|\-|\/|\* | # valid non-word token + \-?\d+(?:\.\d+)?|!==|<=>|==|!=|<=|>=|\&\&|\|\||\(|\)|,|\!|\^|=|<|>|\||\%|\+|\-|\/|\* | # valid non-word token \b\w+\b | # valid word token \S+ # anything else )/x', $tag_args, $match); diff --git a/docs/designers.sgml b/docs/designers.sgml index 6a307039..0148e2f6 100644 --- a/docs/designers.sgml +++ b/docs/designers.sgml @@ -1462,10 +1462,9 @@ s. Combining Modifiers - You can apply as many modifiers as you like to a variable. The modifiers - will be applied to the variable in the order they are combined, from left - to right. The modifier have to be separated with a | - (pipe) symbol. + You can apply any number of modifiers to a variable. They will be + applied in the order they are combined, from left to right. They must + be separated with a | (pipe) character. combining modifiers @@ -3107,17 +3106,24 @@ OUTPUT: cycle -{* initialize the values *} -{cycle values="#eeeeee,#d0d0d0"} -{cycle} -{cycle} - +{section name=rows loop=$data} +<tr bgcolor="{cycle values="#eeeeee,#d0d0d0"}"> + <td>{$data[rows]}</td> +</tr> +{/section} OUTPUT: -#eeeeee -#d0d0d0 -#eeeeee +<tr bgcolor="#eeeeee"> + <td>1</td> +</tr> +<tr bgcolor="#d0d0d0"> + <td>2</td> +</tr> +<tr bgcolor="#eeeeee"> + <td>3</td> +</tr> + diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 4d65a240..d3e2c518 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -1097,7 +1097,7 @@ class Smarty_Compiler extends Smarty { preg_match_all('/(?> ' . $this->_obj_call_regexp . '(?:' . $this->_mod_regexp . '*) | # valid object call ' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*) | # var or quoted string - \-?\d+|!==|<=>|==|!=|<=|>=|\&\&|\|\||\(|\)|,|\!|\^|=|<|>|\||\%|\+|\-|\/|\* | # valid non-word token + \-?\d+(?:\.\d+)?|!==|<=>|==|!=|<=|>=|\&\&|\|\||\(|\)|,|\!|\^|=|<|>|\||\%|\+|\-|\/|\* | # valid non-word token \b\w+\b | # valid word token \S+ # anything else )/x', $tag_args, $match);