You are here

protected function SampleCsv::getCsvData in Bulk User Registration 8

Returns the sample CSV data.

Return value

string CSV data. Fields separated by comma, rows separated by new line.

1 call to SampleCsv::getCsvData()
SampleCsv::content in src/Controller/SampleCsv.php
Provides a response with downloadable CSV file data.

File

src/Controller/SampleCsv.php, line 33

Class

SampleCsv
Sample CSV controller.

Namespace

Drupal\bulk_user_registration\Controller

Code

protected function getCsvData() {
  $rows[] = implode(',', $this
    ->wrap($this
    ->getFieldNames()));
  $rows[] = 'active-user-default-role,mail1@example.com,1';
  $rows[] = 'blocked-user-default-role,mail2@example.com,0';
  $rows = array_merge($rows, $this
    ->getUserDataWithRole());
  return implode("\n", $rows);
}