Пример #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();
 }
Пример #2
0
 public function init()
 {
     parent::init();
     if (!ArrayHelper::keyExists('url', $this->clientOptions)) {
         throw \yii\base\InvalidConfigException('Url key is missing in clientOptions');
     }
 }
Пример #3
0
 protected function registerWidget($name = null, $id = null)
 {
     if ($name === null) {
         $name = $this->_getUnnamespacedClassName();
     }
     $this->_registerBundle();
     parent::registerWidget($name, $id);
 }
Пример #4
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";
 }
Пример #5
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();
 }
Пример #6
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();
 }
Пример #7
0
 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');
     }
 }
Пример #8
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     echo Html::beginTag('div', $this->options) . "\n";
 }
Пример #9
0
 public function init()
 {
     parent::init();
     echo Html::tag('span', $this->label, ['class' => 'label label-' . $this->cssClasses()]);
 }
Пример #10
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     if ($this->mode === self::MODE_BEGIN) {
         echo Html::beginTag('div', $this->options) . "\n";
     }
 }
Пример #11
0
 public function run()
 {
     parent::run();
     echo Html::tag($this->tagName, $this->encodeLabel ? Html::encode($this->label) : $this->label, $this->options);
     $this->registerAjaxScript();
 }