我安装了yii2 fileupload扩展:
-
php version 7 and linux (putty)
-
php version 7 and 5 and window (cmd)
但失败了!
message that shown to me on composer is :
./composer.json已更新
使用包信息加载composer存储库
更新依赖项(包括require-dev)
包操作:2次安装,0次更新,0次删除
-
安装kartik-v / bootstrap-fileinput(v4.4.8):从缓存加载
-
安装kartik-v / yii2-widget-fileinput(dev-master c549564):克隆c549564
无法从源代码下载kartik-v / yii2-widget-fileinput:无法克隆https://github.com/kartik-v/yii2-widget-fileinput.git,找不到git,检查它是否已安装并且在您的PATH环境中 .
sh:git:命令未找到
现在尝试从dist下载
- 安装kartik-v / yii2-widget-fileinput(dev-master c549564):从缓存加载
包mongosoft / yii2-upload-behavior被放弃了,你应该避免使用它 . 请改用mohorev / yii2-upload-behavior .
写锁文件
生成自动加载文件 .
当我使用这个命令时:
echo '<label class="control-label">Add Attachments</label>';
echo FileInput::widget([
'model' => $model,
'attribute' => 'attachment_1',
'options' => ['multiple' => true]
]);
发生此错误:
Class ‘kartik\widgets\FileInput’ not found
和我在cmd上显示的消息太长了!!
资源有变化吗?我能做什么?
有没有办法手动完成?
你可以在以下网址看到这个扩展名:yii2 fileupload extension
1 回答
好吧,第一个错误显示您必须安装
git
(例如在ubuntu中,您可以使用$ sudo apt install git
执行此操作) . 第二个错误是因为FileInput
文档的命名空间模糊 . 基于This line of code,您应该使用kartik\file\FileInput
作为使用的命名空间 .