1. Christoffer Niska
  2. yii-bootstrap
  3. Issues
Issue #101 resolved

Nav List, horizontal divider

marsuboss
created an issue

Add a horizontal divider by creating an empty list item with the class "divider"

When i try : {{{ $this->widget('bootstrap.widgets.BootMenu', array( 'type'=>'list', 'items'=>array( array('label'=>'Header'), ('---'), array('label'=>'Link 1', 'url'=>'#'),

),

)); }}}

Output (HTML) : {{{ <ul class="nav nav-list"> <li class="nav-header">Header</div> <li class="divider-vertical"></div> <li class><a...>Link 1</a></div> </ul> }}}

I noticed the third line as the attribute 'class' is empty. It should be : {{{ <li><a...>Link 1</a></div> }}}

Comments (4)

  1. marsuboss reporter

    I propose to change in BootMenu.php (Line : 87-88)

    Before :

    if (!is_array($item))
    	echo '<li class="divider-vertical"></li>';
    

    After :

    if (!is_array($item))
    {
    	if ($this->type == self::TYPE_LIST)
    		echo '<li class="divider"></li>';
    	else
    		echo '<li class="divider-vertical"></li>';
    }
    
  2. Log in to comment