if ($photo->load(Yii::$app->request->post())) {
$photo->photo = UploadedFile::getInstances($photo, 'photo');
foreach($photo->photo as $ph){
$name = md5( $ph->baseName).'.'.$ph->extension;
$ph->saveAs('uploads/' . $name );
$ph->name = $name;
$photo->photo = $ph;
$photo->save();
}
return $this->redirect(['photo', 'id' => $model->id]);
//$_POST[POST_NAME][ROW][NAME];
$_POST[POST_NAME][0][NAME];
$_POST[POST_NAME][1][NAME];
$_POST[POST_NAME][2][NAME];
//Далее расфасовуешь
foreach($_POST[POST_NAME] as $query) {
if($model->load($query)) {
$model->save();
}
}