TbCollapse::init PHP Method

init() public method

Initializes the widget.
public init ( )
    public function init()
    {
        if (!isset($this->htmlOptions['id'])) {
            $this->htmlOptions['id'] = $this->getId();
        }
        if (isset($this->parent) && !isset($this->options['parent'])) {
            $this->options['parent'] = $this->parent;
        }
        if (isset($this->toggle) && !isset($this->options['toggle'])) {
            $this->options['toggle'] = $this->toggle;
        }
        // NOTE: we depend on the htmlOptions being initialized to empty array already.
        if (empty($this->htmlOptions['class'])) {
            $this->htmlOptions['class'] = 'collapse';
        } else {
            $this->htmlOptions['class'] .= ' collapse';
        }
        echo CHtml::openTag($this->tagName, $this->htmlOptions);
    }