public function registerClientScript()
    {
        /* publish assets dir */
        $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);

        /* @var $cs CClientScript */
        $cs = Yii::app()->getClientScript();

        $min = $this->debugMode
            ? '.min'
            : '';

        $cs->registerCssFile($assetsUrl . '/css/bootstrap-switch.css');
        $cs->registerScriptFile($assetsUrl . '/js/bootstrap-switch' . $min . '.js', CClientScript::POS_END);

        if ($this->events) {
            /* initialize plugin */
            $selector = '#' . TbArray::getValue('id', $this->pluginOptions);

            $this->getApi()->registerEvents($selector, $this->events);
        }
    }
public function registerClientScript()
    {
        /* publish assets dir */
        $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);

        /* @var $cs CClientScript */
        $cs = Yii::app()->getClientScript();

        $min = $this->debugMode
            ? '.min'
            : '';

        $cs->registerCssFile($assetsUrl . '/css/bootstrap-switch.css');
        $cs->registerScriptFile($assetsUrl . '/js/bootstrap-switch' . $min . '.js', CClientScript::POS_END);

        if ($this->events) {
            /* initialize plugin */
            $selector = '#' . TbArray::getValue('id', $this->pluginOptions);

            $this->getApi()->registerEvents($selector, $this->events);
        }
    }
public function registerClientScript ( ) { /* publish assets dir */ $ path = dirname ( __FILE__ ) . DIRECTORY_SEPARATOR . 'assets' ; $ assetsUrl = $ this -> getAssetsUrl ( $ path ) ; /* @var $cs CClientScript */ $ cs = Yii :: app ( ) -> getClientScript ( ) ; $ min = $ this -> debugMode ? '.min' : '' ; $ cs -> registerCssFile ( $ assetsUrl . '/css/bootstrap-switch.css' ) ; $ cs -> registerScriptFile ( $ assetsUrl . '/js/bootstrap-switch' . $ min . '.js' , CClientScript :: POS_END ) ; if ( $ this -> events ) { /* initialize plugin */ $ selector = '#' . TbArray :: getValue ( 'id' , $ this -> pluginOptions ) ; $ this -> getApi ( ) -> registerEvents ( $ selector , $ this -> events ) ; } }
Registers required client script for bootstrap typeahead. It is not used through bootstrap->registerPlugin
in order to attach events if any
Registers required client script for bootstrap typeahead . It is not used through bootstrap - > registerPlugin in order to attach events if any