Example #1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->initOptions();
     echo Ui::beginTag('div', $this->options) . "\n";
     echo $this->renderBodyBegin() . "\n";
 }
Example #2
0
 /**
  * @inheritdoc
  * @throws InvalidConfigException
  */
 public function init()
 {
     if (!$this->hasModel() && $this->name === null) {
         throw new InvalidConfigException("Either 'name', or 'model' and 'attribute' properties must be specified.");
     }
     if (!isset($this->options['id'])) {
         $this->options['id'] = $this->hasModel() ? Html::getInputId($this->model, $this->attribute) : $this->getId();
     }
     parent::init();
 }
Example #3
0
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     if ($this->percent !== null) {
         $this->clientOptions['percent'] = $this->percent;
     }
     if (!empty($this->size)) {
         Html::addCssClass($this->options, $this->size);
     }
     Html::addCssClass($this->barOptions, 'bar');
     Html::addCssClass($this->options, 'progress');
 }
Example #4
0
 /**
  * @inheritdoc
  * @throws InvalidConfigException
  */
 public function init()
 {
     parent::init();
     if ($this->context === null) {
         throw new InvalidConfigException('"context" cannot be null.');
     }
     if ($this->content === null) {
         throw new InvalidConfigException('"content" cannot be null.');
     }
     $this->clientOptions['context'] = $this->context;
     $this->selector = '.ui.sticky';
     Html::addCssClass($this->options, 'rail');
 }
Example #5
0
 /**
  * @throws InvalidConfigException
  */
 public function init()
 {
     if ($this->image === null) {
         throw new InvalidConfigException('"image" cannot be null.');
     }
     if ($this->source === null) {
         throw new InvalidConfigException('"source" cannot be null.');
     }
     if ($this->videoId === null && $this->url === null) {
         throw new InvalidConfigException('"videoId" or "url" must be set. Both cannot be null.');
     }
     $this->clientOptions['source'] = $this->source;
     $this->clientOptions['id'] = $this->videoId;
     $this->clientOptions['url'] = $this->url;
     Html::addCssClass($this->options, 'video');
     parent::init();
 }
Example #6
0
 /**
  * @inheritdoc
  * @throws InvalidConfigException
  */
 public function init()
 {
     if ($this->max <= 0) {
         throw new InvalidConfigException("Max rating number cannot be less or equal to 0.");
     }
     if ($this->rating !== null) {
         if ($this->rating > $this->max) {
             throw new InvalidConfigException("Rating number cannot be higher than Max rating number.");
         }
         $this->options['data-rating'] = $this->rating;
     }
     $this->options['data-max-rating'] = $this->max;
     if (!empty($this->size)) {
         Html::addCssClass($this->options, $this->size);
     }
     Html::addCssClass($this->options, 'rating');
     parent::init();
 }
Example #7
0
 /**
  * @ineritdoc
  */
 public function init()
 {
     parent::init();
     Html::addCssClass($this->options, 'breadcrumb');
 }
Example #8
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     $this->initOptions();
     echo $this->renderToggleButton() . "\n";
     echo Html::beginTag('div', $this->options) . "\n";
     echo $this->renderHeader() . "\n";
     echo $this->renderBodyBegin() . "\n";
 }
Example #9
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     Html::addCssClass($this->options, 'accordion');
 }
Example #10
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     Html::addCssClass($this->options, 'shape');
     Html::addCssClass($this->sidesOptions, 'sides');
 }
Example #11
0
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     Html::addCssClass($this->options, 'dropdown');
     Html::addCssClass($this->itemsOptions, 'menu');
 }