CsvView\View\CsvView::_setupViewVars PHP Метод

_setupViewVars() защищенный Метод

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 fputscsv() - '_newline': (default '\n') CSV Newline replacement for use with fputscsv() - '_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
protected _setupViewVars ( ) : void
Результат void
    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'];
        }
    }