Commit c3df0bee by Qiang Xue

changed parameter ordering.

parent 2356e933
......@@ -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
......
......@@ -388,7 +388,7 @@ EOD;
EOD;
$this->assertEqualsWithoutLE($expected, Html::ul($data, array(
'class' => 'test',
'item' => function($index, $item) {
'item' => function($item, $index) {
return "<li class=\"item-$index\">$item</li>";
}
)));
......@@ -418,7 +418,7 @@ EOD;
EOD;
$this->assertEqualsWithoutLE($expected, Html::ol($data, array(
'class' => 'test',
'item' => function($index, $item) {
'item' => function($item, $index) {
return "<li class=\"item-$index\">$item</li>";
}
)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment