Exemple #1
1
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     if ($this->hasModel() && !isset($this->options['id'])) {
         $this->options['id'] = Html::getInputId($this->model, $this->attribute);
     }
     parent::init();
 }
 public function init()
 {
     parent::init();
     if (!ArrayHelper::keyExists('url', $this->clientOptions)) {
         throw \yii\base\InvalidConfigException('Url key is missing in clientOptions');
     }
 }
Exemple #3
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->model === null) {
         throw new InvalidConfigException('The "model" property must be set.');
     }
     $this->initOptions();
     echo Html::beginTag('div', $this->options) . "\n";
 }
Exemple #4
0
 /**
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     parent::init();
     // Make sure we have an id to bind the slider to
     if (empty($this->id)) {
         throw new \yii\base\InvalidConfigException('The id is required and cannot be empty.');
     }
     $this->registerToView();
 }
Exemple #5
0
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     if (!$this->hasModel() && $this->name === null) {
         throw new InvalidConfigException("Either 'name', or 'model' and 'attribute' properties must be specified.");
     }
     if ($this->hasModel() && !isset($this->options['id'])) {
         $this->options['id'] = Html::getInputId($this->model, $this->attribute);
     }
     parent::init();
 }
 public function init()
 {
     parent::init();
     if ($this->inView and is_array($this->watchers)) {
         echo Html::beginTag('ul', ['class' => 'list-unstyled']);
         foreach ($this->watchers as $uid => $username) {
             echo Html::beginTag('li');
             echo Html::a($username, ['/client/client/view', 'id' => $uid]);
             echo Html::endTag('li');
         }
         echo Html::endTag('ul');
     }
 }
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     if (!$this->url) {
         $this->url = Url::to();
     }
     if (is_array($this->url)) {
         $this->url = Url::to($this->url);
     }
     if (!isset($this->options['id'])) {
         $this->options['id'] = $this->getId() . time();
     }
     if (!isset($this->options['type'])) {
         $this->options['type'] = 'button';
     }
 }
Exemple #8
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     echo Html::beginTag('div', $this->options) . "\n";
 }
 public function init()
 {
     parent::init();
     echo Html::tag('span', $this->label, ['class' => 'label label-' . $this->cssClasses()]);
 }
Exemple #10
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     if ($this->mode === self::MODE_BEGIN) {
         echo Html::beginTag('div', $this->options) . "\n";
     }
 }