Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kartik fileinput error in yii2

Tags:

php

yii2

I installed kartik fileinput via composer and successfully installed!
but when im used that like:

   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
    ]
]);

in backend part, i get error :

Class 'kartik\widgets\FileInput' not found

what's wrong with my code?
Any help appreciated!!!

like image 877
Mohsen Avatar asked Feb 09 '23 17:02

Mohsen


1 Answers

use this..........

use kartik\file\FileInput;
like image 157
vishuB Avatar answered Feb 11 '23 18:02

vishuB