Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.

Commit fe5f96d

Browse files
committed
Fix no attributes in simple list
1 parent 0c1405d commit fe5f96d

File tree

3 files changed

+26
-17
lines changed

3 files changed

+26
-17
lines changed

composer.lock

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/UIKit/Elements/Simple/SimpleList.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ public function unfold(): string
3737
$container = 'dl';
3838

3939
}
40-
return Html::$container(...$listItems)->unfold();
40+
41+
$attributes = $this->getAttr();
42+
return Html::$container(...$listItems)->attr(...$attributes)->unfold();
4143
}
4244

4345
public function ordered(): SimpleList

tests/uikit/SimpleTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ public function testSimpleList()
4444
'good-bye'
4545
)->unfold();
4646
$this->assertEquals($expected, $result);
47+
48+
$expected = '<ul class="test"><li>hello</li><li>good-bye</li></ul>';
49+
$result = UIKit::listWith(
50+
'hello',
51+
'good-bye'
52+
)->attr("class test");
53+
$this->assertEquals($expected, $result->unfold());
4754
}
4855

4956
public function testSimpleOrderedList()

0 commit comments

Comments
 (0)