/** * @param bool $onReady whether or not JS class should be instantiated after page is ready */ public function instantiateJSClass($onReady = true) { parent::instantiateJSClass($onReady); if (isset($this->publisher)) { Yii::app()->clientScript->registerScript($this->namespace . get_class($this) . 'AddTabJS', ($onReady ? "\$(function () {" : "") . $this->publisher->getJSObjectName() . ".addTab (" . $this->getJSObjectName() . ");" . ($onReady ? "});" : ""), CClientScript::POS_END); } }