Skip to content

Latest commit

 

History

History
177 lines (87 loc) · 2.87 KB

class.CSVCore.md

File metadata and controls

177 lines (87 loc) · 2.87 KB

Class CSVCore

Simple class to output CSV data Uses CollectionCore

Contents

Properties

Methods

Properties

$collection

public mixed $collection

$delimiter

public mixed $delimiter

$filename

public mixed $filename

Methods

__construct

mixed CSVCore::__construct(\Collection $collection, string $filename, string $delimiter)

Loads objects, filename and optionnaly a delimiter.

Arguments

  • $collection Collection - collection of objects / array (of non-objects)
  • $filename string - : used later to save the file
  • $delimiter string - Optional : delimiter used

export

mixed CSVCore::export()

Main function Adds headers Outputs

headers

mixed CSVCore::headers()

Adds headers

output

mixed CSVCore::output($data)

Wraps data and echoes Uses defined delimiter

Arguments

  • $data mixed

wrap

string CSVCore::wrap(string $data)

Escapes data

Arguments

  • $data string