From c3df0beecd61c08570945fa4215e1c19cb9a2ec3 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Sun, 7 Jul 2013 09:46:14 -0400 Subject: [PATCH] changed parameter ordering. --- framework/yii/helpers/base/Html.php | 6 +++--- tests/unit/framework/helpers/HtmlTest.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/framework/yii/helpers/base/Html.php b/framework/yii/helpers/base/Html.php index f5a4076..ad83eed 100644 --- a/framework/yii/helpers/base/Html.php +++ b/framework/yii/helpers/base/Html.php @@ -855,7 +855,7 @@ class Html * The signature of this callback must be: * * ~~~ - * function ($index, $item) + * function ($item, $index) * ~~~ * * where $index is the array key corresponding to `$item` in `$items`. The callback should return @@ -876,7 +876,7 @@ class Html $results = array(); foreach ($items as $index => $item) { if ($formatter !== null) { - $results[] = call_user_func($formatter, $index, $item); + $results[] = call_user_func($formatter, $item, $index); } else { $results[] = static::tag('li', $encode ? static::encode($item) : $item, $itemOptions); } @@ -897,7 +897,7 @@ class Html * The signature of this callback must be: * * ~~~ - * function ($index, $item) + * function ($item, $index) * ~~~ * * where $index is the array key corresponding to `$item` in `$items`. The callback should return diff --git a/tests/unit/framework/helpers/HtmlTest.php b/tests/unit/framework/helpers/HtmlTest.php index aef2855..61331e0 100644 --- a/tests/unit/framework/helpers/HtmlTest.php +++ b/tests/unit/framework/helpers/HtmlTest.php @@ -388,7 +388,7 @@ EOD; EOD; $this->assertEqualsWithoutLE($expected, Html::ul($data, array( 'class' => 'test', - 'item' => function($index, $item) { + 'item' => function($item, $index) { return "
  • $item
  • "; } ))); @@ -418,7 +418,7 @@ EOD; EOD; $this->assertEqualsWithoutLE($expected, Html::ol($data, array( 'class' => 'test', - 'item' => function($index, $item) { + 'item' => function($item, $index) { return "
  • $item
  • "; } )));