code: public function init()
      {
          parent::init();
          if($this->type){
              $class = ($this->type == self::DROPDOWN) ? 'dropdown-menu' : 'treeview-menu';
              Html::addCssClass($this->options,$class);
          }else{
              Html::addCssClass($this->options, 'dropdown-menu');   
          }
      }
docs: Initializes the widget.
  If you override this method, make sure you call the parent implementation first.