TbCollapse::getNextContainerId PHP Method

getNextContainerId() public static method

Returns the next collapse container ID.
public static getNextContainerId ( ) : string
return string the id
    public static function getNextContainerId()
    {
        return self::CONTAINER_PREFIX . self::$_containerId++;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  *### .run()
  *
  * Runs the widget.
  */
 public function run()
 {
     echo CHtml::openTag('div', $this->htmlOptions);
     echo '<div class="navbar-inner"><div class="' . $this->getContainerCssClass() . '">';
     $collapseId = null === $this->collapseName ? '#' . TbCollapse::getNextContainerId() : $this->collapseName;
     if ($this->collapse !== false) {
         echo '<a class="btn btn-navbar" data-toggle="collapse" data-target="' . $collapseId . '">';
         echo '<span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>';
         echo '</a>';
     }
     if ($this->brand !== false) {
         if ($this->brandUrl !== false) {
             echo CHtml::openTag('a', $this->brandOptions) . $this->brand . '</a>';
         } else {
             unset($this->brandOptions['href']);
             // spans cannot have a href attribute
             echo CHtml::openTag('span', $this->brandOptions) . $this->brand . '</span>';
         }
     }
     foreach ($this->items as $item) {
         if (is_string($item)) {
             echo $item;
         } else {
             if (isset($item['class'])) {
                 $className = $item['class'];
                 unset($item['class']);
                 $this->controller->widget($className, $item);
             }
         }
     }
     echo '</div></div></div>';
 }
All Usage Examples Of TbCollapse::getNextContainerId