# HtmlList
`htmlList($items, $ordered, $attribs, $escape)` generates unordered and ordered
lists based on the `$items` passed to it. If `$items` is a multidimensional
array, a nested list will be built. If the `$escape` flag is `true` (default),
individual items will be escaped using the view objects registered escaping
mechanisms; pass a `false` value if you want to allow markup in your lists.
## Basic Usage
### Unordered list
```php
$items = [
'Level one, number one',
[
'Level two, number one',
'Level two, number two',
[
'Level three, number one'
],
'Level two, number three',
],
'Level one, number two',
];
echo $this->htmlList($items);
```
Output:
```html
- Level one, number one
- Level two, number one
- Level two, number two
- Level two, number three
- Level one, number two
```
### Ordered list
```php
echo $this->htmlList($items, true);
```
Output:
```html
- Level one, number one
- Level two, number one
- Level two, number two
- Level three, number one
- Level two, number three
- Level one, number two
```
### HTML attributes
```php
$attribs = ['class' => 'foo'];
echo $this->htmlList($items, false, $attribs);
```
Output:
```html
- Level one, number one
- Level two, number one
- Level two, number two
- Level two, number three
- Level one, number two
```
### Escape Output
```php
$items = [
'Level one, number one',
'Level one, number two',
];
// Escape output (default)
echo $this->htmlList($items);
// Don't escape output
echo $this->htmlList($items, false, false, false);
```
Output:
```html
- Level one, number <strong>one</strong>
- Level one, number <em>two</em>
- Level one, number one
- Level one, number two
```