Commit 6d2c80fe2d8570caa18c196504577b066c40ef5f
1 parent
c3a52936
fix issue with wrong determination file extension
Showing
2 changed files
with
6 additions
and
2 deletions
Show diff stats
examples/ParserController.php
@@ -88,6 +88,10 @@ class ParserController extends Controller | @@ -88,6 +88,10 @@ class ParserController extends Controller | ||
88 | return 'xml'; | 88 | return 'xml'; |
89 | case 3: | 89 | case 3: |
90 | return 'xlsx'; | 90 | return 'xlsx'; |
91 | + case 4: | ||
92 | + return 'xls'; | ||
93 | + case 5: | ||
94 | + return 'txt'; | ||
91 | default: | 95 | default: |
92 | return 'csv'; | 96 | return 'csv'; |
93 | } | 97 | } |
@@ -140,7 +144,7 @@ class ParserController extends Controller | @@ -140,7 +144,7 @@ class ParserController extends Controller | ||
140 | $header_model = DynamicFormHelper::CreateDynamicModel($header_counts); | 144 | $header_model = DynamicFormHelper::CreateDynamicModel($header_counts); |
141 | 145 | ||
142 | // колонки для выбора возьмем из конфигурационного файла | 146 | // колонки для выбора возьмем из конфигурационного файла |
143 | - $basicColumns = Yii::$app->multiparser->getConfiguration($this->file_extension, 'basic_column');; | 147 | + $basicColumns = Yii::$app->multiparser->getConfiguration($this->file_extension, 'basic_column'); |
144 | 148 | ||
145 | return $this->render('results', | 149 | return $this->render('results', |
146 | ['model' => $data, | 150 | ['model' => $data, |
examples/config.php
@@ -19,7 +19,7 @@ return [ | @@ -19,7 +19,7 @@ return [ | ||
19 | ], | 19 | ], |
20 | 'converter_conf' => [ | 20 | 'converter_conf' => [ |
21 | 'class' => 'yii\multiparser\Converter', | 21 | 'class' => 'yii\multiparser\Converter', |
22 | - 'configuration' => ["encode" => 'Description', | 22 | + 'configuration' => ['encode' => 'Description', |
23 | "string" => ['Description', 'Brand'], | 23 | "string" => ['Description', 'Brand'], |
24 | "float" => 'Price', | 24 | "float" => 'Price', |
25 | "integer" => 'Count' | 25 | "integer" => 'Count' |