Blame view

backend/components/parsers/CustomCsvParser.php 569 Bytes
d0a7acb3   Mihail   refactor CsvParse...
1
2
3
4
5
6
7
8
9
10
11
  <?php
  /**
   * Created by PhpStorm.
   * User: Cibermag
   * Date: 04.09.2015
   * Time: 16:07
   */
  
  namespace backend\components\parsers;
  
  
0c8b9dfc   Mihail   add error excepti...
12
  class CustomCsvParser extends  \yii\multiparser\CsvParser {
d0a7acb3   Mihail   refactor CsvParse...
13
  
7a80e74c   Mihail   add DynamicFormHe...
14
15
16
      //public $last_line = 10;
      //public $hasHeaderRow = true;
     // public $keys = ['first','second', 'third', 'forth', 'fifth'];
02e174a3   Mihail   work with custome...
17
18
  
  
d0a7acb3   Mihail   refactor CsvParse...
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
      protected function readRow()
      {
  
          $row = parent::readRow();
  
          if (is_array($row)) {
  
              $row = Encoder::encodeArray( Encoder::$in_charset, Encoder::$out_charset, $row );
          }
  
          return $row;
  
      }
  
  }