\CSVCore

Simple class to output CSV data Uses CollectionCore

Summary

Methods
Properties
Constants
__construct()
export()
output()
wrap()
headers()
$filename
$collection
$delimiter
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$filename

$filename : 

Type

$collection

$collection : 

Type

$delimiter

$delimiter : 

Type

Methods

__construct()

__construct(\Collection  $collection, string  $filename, string  $delimiter = ';') 

Loads objects, filename and optionnaly a delimiter.

Parameters

\Collection $collection

collection of objects / array (of non-objects)

string $filename

: used later to save the file

string $delimiter

Optional : delimiter used

export()

export() 

Main function Adds headers Outputs

output()

output(  $data) 

Wraps data and echoes Uses defined delimiter

Parameters

$data

wrap()

wrap(string  $data) : string

Escapes data

Parameters

string $data

Returns

string —

$data

headers()

headers() 

Adds headers