diff options
author | xue <> | 2006-04-07 18:44:07 +0000 |
---|---|---|
committer | xue <> | 2006-04-07 18:44:07 +0000 |
commit | 1d94593d09b68786f7035e7b06ec6d8324894d77 (patch) | |
tree | 8922c1a64f6f2d49875d31667fae542be9a41eea /framework/Web/UI/WebControls/TListControl.php | |
parent | 095e118cd4469f1b77e920a0238798d23089ae8d (diff) |
Format string in classes extending TListControl can now evaluate an expression
Diffstat (limited to 'framework/Web/UI/WebControls/TListControl.php')
-rw-r--r-- | framework/Web/UI/WebControls/TListControl.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php index 37c232e6..5c1e9083 100644 --- a/framework/Web/UI/WebControls/TListControl.php +++ b/framework/Web/UI/WebControls/TListControl.php @@ -11,17 +11,13 @@ */
/**
- * Includes TDataBoundControl class
+ * Includes the supporting classes
*/
Prado::using('System.Web.UI.WebControls.TDataBoundControl');
-/**
- * Includes TAttributeCollection class
- */
Prado::using('System.Collections.TAttributeCollection');
-/**
- * Includes TDataFieldAccessor class
- */
Prado::using('System.Util.TDataFieldAccessor');
+Prado::using('System.Util.TDataValueFormatter');
+
/**
* TListControl class
@@ -75,7 +71,7 @@ Prado::using('System.Util.TDataFieldAccessor'); * the second item's text be 'Cary', value be 28, and so on.
* The {@link setDataTextFormatString DataTextFormatString} property may be further
* used to format how the item should be displayed. The formatting function is
- * the sprintf() PHP function.
+ * {@link TDataValueFormatter::format()}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Revision: $ $Date: $
@@ -192,7 +188,7 @@ abstract class TListControl extends TDataBoundControl $text=$object;
$item->setValue("$key");
}
- $item->setText($textFormat===''?$text:sprintf($textFormat,$text));
+ $item->setText(TDataValueFormatter::format($textFormat,$text,$this));
$items->add($item);
}
// SelectedValue or SelectedIndex may be set before databinding
@@ -329,9 +325,10 @@ abstract class TListControl extends TDataBoundControl /**
* Sets data text format string.
- * The format string is used in sprintf() to format the Text property value
+ * The format string is used in {@link TDataValueFormatter::format()} to format the Text property value
* of each item in the list control.
* @param string the formatting string used to control how data bound to the list control is displayed.
+ * @see TDataValueFormatter::format()
*/
public function setDataTextFormatString($value)
{
|