init() public method

Initializes the widget.
public init ( )
コード例 #1
0
 /**
  *### .init()
  *
  * Widget initialization
  */
 public function init()
 {
     if (!$this->data instanceof CModel) {
         throw new CException('Property "data" should be of CModel class.');
     }
     parent::init();
 }
コード例 #2
0
 /**
  *### .init()
  *
  * Widget initialization
  */
 public function init()
 {
     if (!$this->data instanceof CModel) {
         throw new CException('Property "data" should be of CModel class.');
     }
     //set bootstrap css
     $this->htmlOptions = array('class' => 'table table-bordered table-striped table-hover');
     //disable loading Yii's css for bootstrap
     $this->cssFile = false;
     parent::init();
 }
コード例 #3
0
 /**
  *### .init()
  *
  * Widget initialization
  */
 public function init()
 {
     if (!$this->data instanceof CModel) {
         throw new CException('Property "data" should be of CModel class.');
     }
     if (!is_array($this->htmlOptions)) {
         $this->htmlOptions = array();
     }
     // Default css classes
     $defaultClasses = 'table table-bordered table-striped table-hover';
     if (!isset($this->htmlOptions['class'])) {
         $this->htmlOptions['class'] = $defaultClasses;
     } else {
         $this->htmlOptions['class'] .= ' ' . $defaultClasses;
     }
     $this->cssFile = false;
     parent::init();
 }
コード例 #4
0
 /**
  *
  */
 public function init()
 {
     parent::init();
     Yii::app()->clientScript->registerCssFile(YiiEmbed::assetsUrl() . '/css/detail-view.css');
 }