Options for $options:
- tag - Type of list tag to use (ol/ul)
Options for $itemOptions:
- even - Class to use for even rows.
- odd - Class to use for odd rows.
public nestedList ( array $list, array $options = [], array $itemOptions = [] ) : string | ||
$list | array | Set of elements to list |
$options | array | Options and additional HTML attributes of the list (ol/ul) tag. |
$itemOptions | array | Options and additional HTML attributes of the list item (LI) tag. |
return | string | The nested list |
/** * Returns a list (`<ol>` or `<ul>` tag) * @param array $list Elements list * @param array $options HTML attributes of the list tag * @param array $itemOptions HTML attributes of the list items * @return string */ public function nestedList(array $list, array $options = [], array $itemOptions = []) { if (!empty($options['icon'])) { $itemOptions['icon'] = $options['icon']; } if (!empty($itemOptions['icon'])) { $options = $this->optionsValues(['class' => 'fa-ul'], $options); $itemOptions = $this->optionsValues(['icon' => 'li'], $itemOptions); $list = array_map(function ($element) use($itemOptions) { return firstValue($this->addIconToText($element, $itemOptions)); }, $list); } unset($options['icon'], $options['icon-align'], $itemOptions['icon'], $itemOptions['icon-align']); return parent::nestedList($list, $options, $itemOptions); }