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