3
我通過作曲者安裝了kartik fileinput併成功安裝!
但是當IM使用的,如:yii2中的kartik fileinput錯誤
use yii\helpers\Url;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\widgets\FileInput;
echo FileInput::widget([
'name' => 'attachment_48[]',
'options' => [
'multiple' => true
],
'pluginOptions' => [
'uploadUrl' => Url::to(['/site/file-upload']),
'uploadExtraData' => [
'album_id' => 20,
'cat_id' => 'Nature'
],
'maxFileCount' => 10
]
]);
在後端部分,我得到錯誤:
Class 'kartik\widgets\FileInput' not found
有什麼錯我的代碼?
任何幫助表示讚賞!
你知道它爲什麼是這樣呢? – Amir
@Amir因爲'FileInput.php'中存在'namespace kartik \ file'。 –