PHP 클래스 yii\apidoc\templates\bootstrap\SideNavWidget

For example: php echo Nav::widget([ 'items' => [ [ 'label' => 'Home', 'url' => ['site/index'], 'linkOptions' => [...], ], [ 'label' => 'Dropdown', 'items' => [ ['label' => 'Level 1 - Dropdown A', 'url' => '#'], '
  • ', '', ['label' => 'Level 1 - Dropdown B', 'url' => '#'], ], ], ], ]);
    Note: Multilevel dropdowns beyond Level 1 are not supported in Bootstrap 3.
    또한 보기: http://getbootstrap.com/components.html#dropdowns
    또한 보기: http://getbootstrap.com/components/#nav
    부터: 2.0
    저자: Antonio Ramirez ([email protected])
    상속: extends yii\bootstrap\Widget
    파일 보기 프로젝트 열기: yiisoft/yii2-apidoc 1 사용 예제들

    공개 프로퍼티들

    프로퍼티 타입 설명
    $activeUrl the route used to determine if a menu item is active or not. If not set, it will use the route of the current request.
    $encodeLabels whether the nav items labels should be HTML-encoded.
    $items list of items in the nav widget. Each array element represents a single menu item which can be either a string or an array with the following structure: - label: string, required, the nav item label. - url: optional, the item's URL. Defaults to "#". - visible: boolean, optional, whether this menu item is visible. Defaults to true. - linkOptions: array, optional, the HTML attributes of the item's link. - options: array, optional, the HTML attributes of the item container (LI). - active: boolean, optional, whether the item should be on active state or not. - items: array|string, optional, the configuration array for creating a [[Dropdown]] widget, or a string representing the dropdown menu. Note that Bootstrap does not support sub-dropdown menus. If a menu item is a string, it will be rendered directly without HTML encoding.

    공개 메소드들

    메소드 설명
    init ( ) Initializes the widget.
    renderItem ( string | array $item, boolean $collapsed = true ) : string Renders a widget's item.
    renderItems ( ) Renders widget items.
    run ( ) Renders the widget.

    메소드 상세

    init() 공개 메소드

    Initializes the widget.
    public init ( )

    renderItem() 공개 메소드

    Renders a widget's item.
    public renderItem ( string | array $item, boolean $collapsed = true ) : string
    $item string | array the item to render.
    $collapsed boolean whether to collapse item if not active
    리턴 string the rendering result.

    renderItems() 공개 메소드

    Renders widget items.
    public renderItems ( )

    run() 공개 메소드

    Renders the widget.
    public run ( )

    프로퍼티 상세

    $activeUrl 공개적으로 프로퍼티

    the route used to determine if a menu item is active or not. If not set, it will use the route of the current request.
    또한 보기: params
    또한 보기: isItemActive
    public $activeUrl

    $encodeLabels 공개적으로 프로퍼티

    whether the nav items labels should be HTML-encoded.
    public $encodeLabels

    $items 공개적으로 프로퍼티

    list of items in the nav widget. Each array element represents a single menu item which can be either a string or an array with the following structure: - label: string, required, the nav item label. - url: optional, the item's URL. Defaults to "#". - visible: boolean, optional, whether this menu item is visible. Defaults to true. - linkOptions: array, optional, the HTML attributes of the item's link. - options: array, optional, the HTML attributes of the item container (LI). - active: boolean, optional, whether the item should be on active state or not. - items: array|string, optional, the configuration array for creating a [[Dropdown]] widget, or a string representing the dropdown menu. Note that Bootstrap does not support sub-dropdown menus. If a menu item is a string, it will be rendered directly without HTML encoding.
    public $items