Overview

Namespaces

  • PHP
  • SimpleExcel
    • Enums
    • Parser
    • Spreadsheet
    • Writer

Classes

  • SimpleExcel
  • Overview
  • Namespace
  • Class
  • Tree

Class SimpleExcel

SimpleExcel main class

Namespace: SimpleExcel
Package: SimpleExcel
Author: Faisalman
Located at SimpleExcel.php
Methods summary
public
# __construct( string $filetype = NULL )

SimpleExcel constructor method

SimpleExcel constructor method

Parameters

$filetype
string
$filetype Set the filetype of the file
public
# exportFile( string $target, string $fileType, string $options = NULL )

Export data as file

Export data as file

Parameters

$target
string
$target Where to write the file
$fileType
string
$filetype Type of the file to be written
$options
string
$options Options

Throws

Exception
If filetype is not supported
Exception
If error writing file
public SimpleExcel\Spreadsheet\Worksheet
# getWorksheet( integer $index = 1 )

Get specified worksheet

Get specified worksheet

Parameters

$index
integer
$index Worksheet index

Returns

SimpleExcel\Spreadsheet\Worksheet

Throws

Exception
If worksheet with specified index is not found
public array
# getWorksheets( )

Get all worksheets

Get all worksheets

Returns

array
public
# insertWorksheet( SimpleExcel\Spreadsheet\Worksheet $worksheet )

Insert a worksheet

Insert a worksheet

Parameters

$worksheet
SimpleExcel\Spreadsheet\Worksheet
$worksheet Worksheet to be inserted
public
# loadFile( string $filePath, string $fileType, string $options = NULL )

Load file to parser

Load file to parser

Parameters

$filePath
string
$filepath Path to file
$fileType
string
$filetype Set the filetype of the file which will be parsed
$options
string
$options Options

Throws

Exception
If filetype is not supported
Exception
If file being loaded doesn't exist
Exception
If file extension doesn't match
Exception
If error reading the file
public
# loadString( string $string, string $fileType )

Load string to parser

Load string to parser

Parameters

$string
string
$filepath Path to file
$fileType
string
$filetype Set the filetype of the file which will be parsed

Throws

Exception
If filetype is not supported
public
# removeWorksheet( integer $index )

Remove a worksheet

Remove a worksheet

Parameters

$index
integer
$index Worksheet index to be removed
protected
# setParserType( string $filetype )

Construct a SimpleExcel Parser

Construct a SimpleExcel Parser

Parameters

$filetype
string
$filetype Set the filetype of the file which will be parsed (XML/CSV/TSV/HTML/JSON)

Throws

Exception
If filetype is not supported
protected
# setWriterType( string $filetype )

Construct a SimpleExcel Writer

Construct a SimpleExcel Writer

Parameters

$filetype
string
$filetype Set the filetype of the file which will be written

Throws

Exception
If filetype is not supported
public string
# toString( string $filetype, string $options = NULL )

Get data as string

Get data as string

Parameters

$filetype
string
$filetype Document format for the string to be returned
$options
string
$options Options

Returns

string

Throws

Exception
If filetype is not supported
Properties summary
protected IParser $parser
#
protected string $parserType
#
protected array $validParserTypes
#
protected array $validWriterTypes
#
protected IWriter $writer
#
protected string $writerType
#
public SimpleExcel\Spreadsheet\Workbook $workbook
#
API documentation generated by ApiGen 2.8.0