Following code works quite fine with just one Upload-File. How to change code in order to upload several files?
'multiple' => true
obviously is not enough!
<?=
$form->field($model, 'avatar[]')->widget(FileInput::classname(), [
'options' => ['accept' => 'image/*', 'multiple' => true]])
?>
Furthermore, I present my model
<?php
//Code programmed by Thomas Kipp
//Change it, learn it, do as u please!
///path:/models/
namespace frontend\models;
use Yii;
use yii\base\Model;
class myScriptForm extends Model{ // A new Class programmed by Thomas Kipp
public $rating;
public $username;
public $password;
public $email;
public $zahl_up;
public $zahl_down;
public $iteration;
public $rememberMe;
public $Urlaubsziel;
public $Urlaubsziel_database;
public $Automarke;
public $Geschlecht;
public $subject;
public $body;
public $fileImage;
public $avatar;
public $datetime;
public function rules() {
$avatar=array();
return [
['datetime', 'string'],
['rememberMe', 'boolean'],
['avatar[]','file'],
['fileImage', 'file'],
['email', 'email'],
['email', 'required'],
['subject', 'string'],
['body', 'string'],
['Urlaubsziel', 'string'],
['Urlaubsziel_database', 'string'],
['Geschlecht', 'string'],
['username', 'required'],
['password', 'string'],
['zahl_down', 'integer', 'min' => 1, 'max' => 5],
['rating', 'integer', 'min' => 1, 'max' => 10],
['zahl_down', 'required'],
['zahl_up', 'integer', 'min' => 1000, 'max' => 2500],
['zahl_up', 'required'],
['iteration', 'integer', 'min' => 10, 'max' => 50],
['iteration', 'required']];
}
}
//End of class
?>