src/View/CsvView.php
protected function _setupViewVars()
    {
        foreach ($this->_specialVars as $viewVar) {
            if (!isset($this->viewVars[$viewVar])) {
                $this->viewVars[$viewVar] = null;
            }
        }

        if ($this->viewVars['_delimiter'] === null) {
            $this->viewVars['_delimiter'] = ',';
        }

        if ($this->viewVars['_enclosure'] === null) {
            $this->viewVars['_enclosure'] = '"';
        }

        if ($this->viewVars['_newline'] === null) {
            $this->viewVars['_newline'] = "\n";
        }

        if ($this->viewVars['_eol'] === null) {
            $this->viewVars['_eol'] = PHP_EOL;
        }

        if ($this->viewVars['_null'] === null) {
            $this->viewVars['_null'] = '';
        }

        if ($this->viewVars['_bom'] === null) {
            $this->viewVars['_bom'] = false;
        }

        if ($this->viewVars['_setSeparator'] === null) {
            $this->viewVars['_setSeparator'] = false;
        }

        if ($this->viewVars['_dataEncoding'] === null) {
            $this->viewVars['_dataEncoding'] = 'UTF-8';
        }

        if ($this->viewVars['_csvEncoding'] === null) {
            $this->viewVars['_csvEncoding'] = 'UTF-8';
        }

        if ($this->viewVars['_extension'] === null) {
            $this->viewVars['_extension'] = self::EXTENSION_ICONV;
        }

        if ($this->viewVars['_extract'] !== null) {
            $this->viewVars['_extract'] = (array)$this->viewVars['_extract'];
        }
    }
protected function _setupViewVars()
    {
        foreach ($this->_specialVars as $viewVar) {
            if (!isset($this->viewVars[$viewVar])) {
                $this->viewVars[$viewVar] = null;
            }
        }

        if ($this->viewVars['_delimiter'] === null) {
            $this->viewVars['_delimiter'] = ',';
        }

        if ($this->viewVars['_enclosure'] === null) {
            $this->viewVars['_enclosure'] = '"';
        }

        if ($this->viewVars['_newline'] === null) {
            $this->viewVars['_newline'] = "\n";
        }

        if ($this->viewVars['_eol'] === null) {
            $this->viewVars['_eol'] = PHP_EOL;
        }

        if ($this->viewVars['_null'] === null) {
            $this->viewVars['_null'] = '';
        }

        if ($this->viewVars['_bom'] === null) {
            $this->viewVars['_bom'] = false;
        }

        if ($this->viewVars['_setSeparator'] === null) {
            $this->viewVars['_setSeparator'] = false;
        }

        if ($this->viewVars['_dataEncoding'] === null) {
            $this->viewVars['_dataEncoding'] = 'UTF-8';
        }

        if ($this->viewVars['_csvEncoding'] === null) {
            $this->viewVars['_csvEncoding'] = 'UTF-8';
        }

        if ($this->viewVars['_extension'] === null) {
            $this->viewVars['_extension'] = self::EXTENSION_ICONV;
        }

        if ($this->viewVars['_extract'] !== null) {
            $this->viewVars['_extract'] = (array)$this->viewVars['_extract'];
        }
    }
protected function _setupViewVars ( ) { foreach ( $ this -> _specialVars as $ viewVar ) { if ( ! isset ( $ this -> viewVars [ $ viewVar ] ) ) { $ this -> viewVars [ $ viewVar ] = null ; } } if ( $ this -> viewVars [ '_delimiter' ] === null ) { $ this -> viewVars [ '_delimiter' ] = ',' ; } if ( $ this -> viewVars [ '_enclosure' ] === null ) { $ this -> viewVars [ '_enclosure' ] = '"' ; } if ( $ this -> viewVars [ '_newline' ] === null ) { $ this -> viewVars [ '_newline' ] = "\n" ; } if ( $ this -> viewVars [ '_eol' ] === null ) { $ this -> viewVars [ '_eol' ] = PHP_EOL ; } if ( $ this -> viewVars [ '_null' ] === null ) { $ this -> viewVars [ '_null' ] = '' ; } if ( $ this -> viewVars [ '_bom' ] === null ) { $ this -> viewVars [ '_bom' ] = false ; } if ( $ this -> viewVars [ '_setSeparator' ] === null ) { $ this -> viewVars [ '_setSeparator' ] = false ; } if ( $ this -> viewVars [ '_dataEncoding' ] === null ) { $ this -> viewVars [ '_dataEncoding' ] = 'UTF-8' ; } if ( $ this -> viewVars [ '_csvEncoding' ] === null ) { $ this -> viewVars [ '_csvEncoding' ] = 'UTF-8' ; } if ( $ this -> viewVars [ '_extension' ] === null ) { $ this -> viewVars [ '_extension' ] = self :: EXTENSION_ICONV ; } if ( $ this -> viewVars [ '_extract' ] !== null ) { $ this -> viewVars [ '_extract' ] = ( array ) $ this -> viewVars [ '_extract' ] ; } }
Setup defaults for CsvView view variables

The following variables can be retrieved from '$this->viewVars'
for use in configuring this view:

- array '_header': (default null)  A flat array of header column names
- array '_footer': (default null)  A flat array of footer column names
- array '_extract': (default null) An array of Hash-compatible paths or
callable with matching 'sprintf'
$format as follows:

$_extract = [
[$path, $format],
[$path],
$path,
function () { ... } // Callable
];

If a string or unspecified, the format
default is '%s'.
- '_delimiter': (default ',')      CSV Delimiter, defaults to comma
- '_enclosure': (default '"')      CSV Enclosure for use with fputcsv()
- '_newline': (default '\n')       CSV Newline replacement for use with fputcsv()
- '_eol': (default '\n')           End-of-line character the csv
- '_bom': (default false)          Adds BOM (byte order mark) header
- '_setSeparator: (default false)  Adds sep=[_delimiter] in the first line

@return void
Setup defaults for CsvView view variables