BsWidget::registerEvents doesn't work

Issue #24 resolved
Yiorgos Tavantzopoulos created an issue

BsWidget::registerEvents doesn't work if you haven't a component 'bootstrap' as an instance of TbApi (??).

A missing dependency here?

Comments (7)

  1. Yiorgos Tavantzopoulos reporter

    Well I was trying to create modal a with the 'BsModal' widget class, but I've realized that it doesn't register the 'onShow' event callback, so I debug it and I found this/

    // /Behaviors/BsWidget.php
        /**
         * Returns the API instance.
         * @return TbApi the api.
         */
        private function getApi()
        {
            if (isset($this->_api)) {
                return $this->_api;
            } else {
                return $this->_api = Yii::app()->getComponent('bootstrap');
            }
        }
    

    As you can see it expects a component with ID 'bootstrap', and as the method comments saying it should be an instance og TbApi, no?

  2. Yiorgos Tavantzopoulos reporter

    It seems to work now. thanks BUT it seems that is missing the BsApi::registerPlugin() too.

  3. Log in to comment