wrapperOptions, " upload-kit-input"); FileUploadAsset::register($this->getView()); if ($this->sortable) { JuiAsset::register($this->getView()); } $options = Json::encode($this->clientOptions); $this->getView()->registerJs("jQuery('#{$this->options['id']}').attachmentFileUpload({$options});"); } protected function formartAttachment($attachment) { if (is_string($attachment) && !empty($attachment)) { $model = Attachment::find()->where(['url' => $attachment])->one(); return [ "url"=>$attachment, "path"=>$attachment, 'filename' => $model ? $model->name : $attachment ]; } else if (is_array($attachment)) { return $attachment; } return null; } }