PHP Class CsvEncodeView, cakephp-rest-plugin

Author: Primeminister
Inheritance: extends View
ファイルを表示 Open project: kvz/cakephp-rest-plugin

Public Methods

Method Description
encode ( array $response ) : string create csv string from response
headers ( $Controller, $settings )
render ( $action = null, $layout = null, $file = null )

Protected Methods

Method Description
_putcsv ( array $row, string $delimiter = ';', string $enclosure = '"', string $eol = " " ) : string Creating a file resource to php://temp so we don;t save a real file and return the string of that csv line

Method Details

_putcsv() protected method

Creating a file resource to php://temp so we don;t save a real file and return the string of that csv line
protected _putcsv ( array $row, string $delimiter = ';', string $enclosure = '"', string $eol = " " ) : string
$row array
$delimiter string
$enclosure string
$eol string
return string

encode() public method

create csv string from response
public encode ( array $response ) : string
$response array with 'meta' and 'data' part
return string

headers() public method

public headers ( $Controller, $settings )

render() public method

public render ( $action = null, $layout = null, $file = null )