helpers\BaseHtml ol()

ol() public static method

Generates an ordered list.

public static string ol ( $items, $options = [] )
$items array|Traversable

The items for generating the list. Each item generates a single list item. Note that items will be automatically HTML encoded if $options['encode'] is not set or true.

$options array

Options (name => config) for the radio button list. The following options are supported:

  • encode: boolean, whether to HTML-encode the items. Defaults to true. This option is ignored if the item option is specified.
  • itemOptions: array, the HTML attributes for the li tags. This option is ignored if the item option is specified.
  • item: callable, a callback that is used to generate each individual list item. The signature of this callback must be:

    function ($item, $index)
    

    where $index is the array key corresponding to $item in $items. The callback should return the whole list item tag.

See renderTagAttributes() for details on how attributes are being rendered.

return string

The generated ordered list. An empty string is returned if $items is empty.

doc_Yii
2016-10-30 17:05:12
Comments
Leave a Comment

Please login to continue.