You are here

public static function PHPExcel_IOFactory::createWriter 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::createWriter()

* Create PHPExcel_Writer_IWriter * * @static * @access public *

Parameters

PHPExcel $phpExcel: * @param string $writerType Example: Excel2007 * @return PHPExcel_Writer_IWriter * @throws PHPExcel_Reader_Exception

77 calls to PHPExcel_IOFactory::createWriter()
01pharSimple.php in vendor/phpoffice/phpexcel/Examples/01pharSimple.php
01simple-download-ods.php in vendor/phpoffice/phpexcel/Examples/01simple-download-ods.php
01simple-download-pdf.php in vendor/phpoffice/phpexcel/Examples/01simple-download-pdf.php
01simple-download-xls.php in vendor/phpoffice/phpexcel/Examples/01simple-download-xls.php
01simple-download-xlsx.php in vendor/phpoffice/phpexcel/Examples/01simple-download-xlsx.php

... See full list

File

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

Class

PHPExcel_IOFactory
PHPExcel_IOFactory

Code

public static function createWriter(PHPExcel $phpExcel, $writerType = '') {

  // Search type
  $searchType = 'IWriter';

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

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