-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix. HTMLhelper ul and ol attributes type #2488
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,10 +52,10 @@ | |
* multi-dimensional array. | ||
* | ||
* @param array $list | ||
* @param string $attributes HTML attributes | ||
* @param array $attributes HTML attributes | ||
* @return string | ||
*/ | ||
function ul(array $list, string $attributes = ''): string | ||
function ul(array $list, array $attributes = []): string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
{ | ||
return _list('ul', $list, $attributes); | ||
} | ||
|
@@ -71,10 +71,10 @@ function ul(array $list, string $attributes = ''): string | |
* Generates an HTML ordered list from an single or multi-dimensional array. | ||
* | ||
* @param array $list | ||
* @param string $attributes HTML attributes | ||
* @param array $attributes HTML attributes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
* @return string | ||
*/ | ||
function ol(array $list, string $attributes = ''): string | ||
function ol(array $list, array $attributes = []): string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
{ | ||
return _list('ol', $list, $attributes); | ||
} | ||
|
@@ -91,11 +91,11 @@ function ol(array $list, string $attributes = ''): string | |
* | ||
* @param string $type | ||
* @param mixed $list | ||
* @param string $attributes | ||
* @param array $attributes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
* @param integer $depth | ||
* @return string | ||
*/ | ||
function _list(string $type = 'ul', $list = [], string $attributes = '', int $depth = 0): string | ||
function _list(string $type = 'ul', $list = [], array $attributes = [], int $depth = 0): string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
{ | ||
// Set the indentation based on the depth | ||
$out = str_repeat(' ', $depth) | ||
|
@@ -120,7 +120,7 @@ function _list(string $type = 'ul', $list = [], string $attributes = '', int $de | |
{ | ||
$out .= $_last_list_item | ||
. "\n" | ||
. _list($type, $val, '', $depth + 4) | ||
. _list($type, $val, [], $depth + 4) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed change |
||
. str_repeat(' ', $depth + 2); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.