From 624e02374af10c82ca98a637300c18b070ce58b8 Mon Sep 17 00:00:00 2001 From: gwoo Date: Thu, 24 May 2007 22:55:05 +0000 Subject: [PATCH] adding and to TextHelper::toList #1934 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5177 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/helpers/text.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index 2f9cc032f..04a853888 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -212,15 +212,14 @@ class TextHelper extends AppHelper { * @param array $list The list to be joined * @return string */ - function toList($list) { + function toList($list, $and = 'and') { $r = ''; $c = count($list) - 1; - foreach ($list as $i => $item) { $r .= $item; if ($c > 0 && $i < $c) { - $r .= ($i < $c - 1 ? ', ' : ' and '); + $r .= ($i < $c - 1 ? ', ' : " {$and} "); } } return $r;