You are here

public static function PHPExcel_IOFactory::createReader in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/IOFactory.php \PHPExcel_IOFactory::createReader()

* Create PHPExcel_Reader_IReader * * @static * @access public *

Parameters

string $readerType Example: Excel2007: * @return PHPExcel_Reader_IReader * @throws PHPExcel_Reader_Exception

18 calls to PHPExcel_IOFactory::createReader()
24readfilter.php in vendor/phpoffice/phpexcel/Examples/24readfilter.php
26utf8.php in vendor/phpoffice/phpexcel/Examples/26utf8.php
27imagesexcel5.php in vendor/phpoffice/phpexcel/Examples/27imagesexcel5.php
28iterator.php in vendor/phpoffice/phpexcel/Examples/28iterator.php
30template.php in vendor/phpoffice/phpexcel/Examples/30template.php

... See full list

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/IOFactory.php, line 161

Class

PHPExcel_IOFactory
PHPExcel_IOFactory

Code

public static function createReader($readerType = '') {

  // Search type
  $searchType = 'IReader';

  // Include class
  foreach (self::$_searchLocations as $searchLocation) {
    if ($searchLocation['type'] == $searchType) {
      $className = str_replace('{0}', $readerType, $searchLocation['class']);
      $instance = new $className();
      if ($instance !== NULL) {
        return $instance;
      }
    }
  }

  // Nothing found...
  throw new PHPExcel_Reader_Exception("No {$searchType} found for type {$readerType}");
}