widgets\Menu $items

$items public property

List of menu items. Each menu item should be an array of the following structure:

  • label: string, optional, specifies the menu item label. When $encodeLabels is true, the label will be HTML-encoded. If the label is not specified, an empty string will be used.
  • encode: boolean, optional, whether this item`s label should be HTML-encoded. This param will override global $encodeLabels param.
  • url: string or array, optional, specifies the URL of the menu item. It will be processed by yii\helpers\Url::to(). When this is set, the actual menu item content will be generated using $linkTemplate; otherwise, $labelTemplate will be used.
  • visible: boolean, optional, whether this menu item is visible. Defaults to true.
  • items: array, optional, specifies the sub-menu items. Its format is the same as the parent items.
  • active: boolean, optional, whether this menu item is in active state (currently selected). If a menu item is active, its CSS class will be appended with $activeCssClass. If this option is not set, the menu item will be set active automatically when the current request is triggered by url. For more details, please refer to isItemActive().
  • template: string, optional, the template used to render the content of this menu item. The token {url} will be replaced by the URL associated with this menu item, and the token {label} will be replaced by the label of the menu item. If this option is not set, $linkTemplate or $labelTemplate will be used instead.
  • submenuTemplate: string, optional, the template used to render the list of sub-menus. The token {items} will be replaced with the rendered sub-menu items. If this option is not set, $submenuTemplate will be used instead.
  • options: array, optional, the HTML attributes for the menu container tag.
public array $items = []
doc_Yii
2016-10-30 17:18:38
Comments
Leave a Comment

Please login to continue.