コード例 #1
0
ファイル: SliderInput.php プロジェクト: bmsrox/yiicomm
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!isset($this->containerOptions['id'])) {
         $this->containerOptions['id'] = $this->options['id'] . '-container';
     }
 }
コード例 #2
0
ファイル: ComboBox.php プロジェクト: CAPITALOV/capitalov
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     $this->fieldId = strtolower($this->model->formName() . '-' . $this->attribute);
     $this->fieldName = $this->model->formName() . '[' . $this->attribute . ']';
     $this->hiddenId = strtolower($this->model->formName() . '-' . $this->attribute . '-files');
     $this->hiddenName = $this->model->formName() . '[' . $this->attribute . '-files' . ']';
 }
コード例 #3
0
 /**
  * @throws Exception
  */
 public function init()
 {
     parent::init();
     if (!isset($this->uploadUrl)) {
         throw new Exception('uploadUrl property should be set');
     }
     if (!isset($this->deleteUrl)) {
         throw new Exception('deleteUrl property should be set');
     }
 }
コード例 #4
0
ファイル: TimePiker.php プロジェクト: Makeyko/galaxysss
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     $this->fieldId = strtolower($this->model->formName() . '-' . $this->attribute);
     $this->fieldName = $this->model->formName() . '[' . $this->attribute . ']';
     if ($this->model) {
         $model = $this->model;
         $attribute = $this->attribute;
         $this->value = $model->{$attribute};
     }
 }
コード例 #5
0
 /**
  * @inheritdoc
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     parent::init();
     $this->registerTranslations();
     if (empty($this->url)) {
         throw new InvalidConfigException('"url" cannot be empty.');
     }
     if (empty($this->formId) && 'ui' == $this->appearance) {
         throw new InvalidConfigException('"formId" cannot be empty in case of "appearance"=="ui".');
     }
     if (empty($this->mainView)) {
         $this->mainView = 'ui' == $this->appearance ? 'mainPlusUI' : 'main';
     }
     $this->clientOptions['url'] = $this->options['data-url'] = Url::to($this->url);
     if (!isset($this->options['multiple'])) {
         $this->options['multiple'] = true;
     }
 }
コード例 #6
0
 public function init()
 {
     parent::init();
     if (empty($this->file)) {
         $this->file = '/admin/upload';
     }
     if (empty($this->title)) {
         $this->title = 'File Manager';
     }
     if (empty($this->width)) {
         $this->width = 700;
     }
     if (empty($this->height)) {
         $this->height = 350;
     }
     if (empty($this->resizable)) {
         $this->resizable = 'yes';
     }
 }
コード例 #7
0
ファイル: DatePicker.php プロジェクト: noname007/yii2-1
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->inline && !isset($this->containerOptions['id'])) {
         $this->containerOptions['id'] = $this->options['id'] . '-container';
     }
     if ($this->dateFormat === null) {
         $this->dateFormat = Yii::$app->formatter->dateFormat;
     }
 }
コード例 #8
0
ファイル: XUpload.php プロジェクト: anujabpnews/yii2-xupload
 /**
  * Publishes the required assets
  */
 public function init()
 {
     parent::init();
 }
コード例 #9
0
 /**
  * @inheritdoc
  * @throws InvalidConfigException
  */
 public function init()
 {
     parent::init();
     if (!$this->hasModel()) {
         throw new InvalidConfigException('Params $model and $attribute are required for ' . get_class($this) . '.');
     }
     $model = $this->model;
     $file = Html::getAttributeValue($model, $this->attribute);
     if (!$file instanceof File) {
         throw new InvalidConfigException("Attribute {$this->attribute} of " . get_class($model) . ' must be an instance of ' . File::className() . ' for usage in ' . get_class($this) . '.');
     }
     if (!isset($this->fileInputOptions['id'])) {
         $this->fileInputOptions['id'] = $this->options['id'] . static::ID_FILE_INPUT_SUFFIX;
     }
     if (!isset($this->hiddenInputOptions['id'])) {
         $this->hiddenInputOptions['id'] = $this->options['id'] . static::ID_HIDDEN_INPUT_SUFFIX;
     }
     if (!isset($this->previewContainerOptions['id'])) {
         $this->previewContainerOptions['id'] = $this->options['id'] . static::ID_PREVIEW_CONTAINER_SUFFIX;
     }
     $this->initClientOptions();
 }