public static function addCssStyle($style, &$htmlOptions)
{
if (is_array($style)) {
$style = implode('; ', $style);
}
$style = rtrim($style, ';');
$htmlOptions['style'] = isset($htmlOptions['style']) ? rtrim($htmlOptions['style'], ';') . '; ' . $style : $style;
}
/** * Initializes the widget. */ public function init() { parent::init(); Yii::import('bootstrap.behaviors.TbWidget'); $this->attachBehavior('tbWidget', new TbWidget()); if (!isset($this->assetPath)) { $this->assetPath = Yii::getPathOfAlias('lib.bootstrap-wysihtml5'); } if (!$this->bindPlugin) { $this->htmlOptions['data-plugin'] = 'wysihtml5'; $this->htmlOptions['data-plugin-options'] = CJSON::encode($this->pluginOptions); } TbHtml::addCssStyle('width: ' . $this->width . 'px; height: ' . $this->height . 'px;', $this->htmlOptions); }