使用yii2和kartik fileInput扩展名上传多个图像

I have this little problem in uploading multiple images using yii2 and Kartik fileInput extension.

this is the model:

 public $file;

public static function tableName()
{
    return 'news';
}

public function rules()
{
    return [
        [['news_desc', 'news_context', 'news_first_source', 'news_second_source', 'news_third_source', 'news_responsibe_party', 'news_first_testimony', 'news_second_testimony', 'news_body', 'news_lang'], 'string'],
        [['news_gov_id', 'news_typ_id', 'news_is_in_slider', 'news_is_act', 'news_is_del'], 'integer'],
        [['news_happened_date', 'news_created_date', 'file'], 'safe'],
        [['news_typ_id', 'news_lang'], 'required'],
        [['news_title'], 'string', 'max' => 255],
        [['file'], 'file','maxFiles' => 6],
    ];
}

as you can notice I am using maxFiles but it didnt worked for me

Controller:

public function actionCreate_news()
{

    $model = new News();

    if ($model->load(Yii::$app->request->post())) {
        $model->file = UploadedFile::getInstances($model, 'file');

        var_dump($model->file);
        die();}}

right now I am just var dump the files I get but the problem there is only one file not all the files i uploaded

view:

echo FileInput::widget([
            'model' => $model,
            'attribute' => 'file[]',
            'name' => 'file[]',
            'options' => [
                'multiple' => 'true',
                'accept' => 'image/*'
            ],
            'pluginOptions' => [
                'showCaption' => false,
                'showRemove' => false,
                'showUpload' => false,
                'allowedFileExtensions' => ['jpg','jpeg','png'],
                'overwriteInitial' => false
            ],
        ]);

i have read all things about this issue and tried all the possible solutions but the problem is still there

when i press submit for the form only the last file will be submited

thanks

Thank you all I figured out the solution for my question i was trying to upload the images when submitting the form but it turned that i was wrong so i used the widget to upload the images using ajax like in here: http://webtips.krajee.com/ajax-based-file-uploads-using-fileinput-plugin/

then using the plugin event i took the names of files to save in the DB when the form submited

Remove 'name' => 'file[]', from this widget also single quotes from true.

echo FileInput::widget([
            'model' => $model,
            'attribute' => 'file[]',
            'options' => [
                'multiple' => true,
                'accept' => 'image/*'
            ],
            'pluginOptions' => [
                'showCaption' => false,
                'showRemove' => false,
                'showUpload' => false,
                'allowedFileExtensions' => ['jpg','jpeg','png'],
                'overwriteInitial' => false
            ],
        ]);

Original:

echo FileInput::widget([
    'model' => $model,
    'attribute' => 'attachment_1[]',
    'options' => ['multiple' => true]
]);