helpers\BaseHtml ul()

ul() public static method

Generates an unordered list.

public static string ul ( $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.
  • separator: string, the HTML code that separates items. Defaults to a simple newline ("\n"). This option is available since version 2.0.7.
  • 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 unordered list. An empty list tag will be returned if $items is empty.

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

Please login to continue.