public function generateSummaryMembersCsv($node) {
    $summary = $this->getSummary($node);

    $header = [
      $this->t('Title'),
      $this->t('Value'),
    ];

    $records = [
      [$this->t('Total amount of members'), $summary['totalMembers']],
      [$this->t('Registered members by Campaign'), $summary['registeredMembers']],
      [$this->t('Percentage of the registered members'), $summary['percentageMembers'] . '%'],
    ];
    $fileName = 'summary_members_' . date('Y-m-d') . '.csv';

    return $this->createCsvResponse($fileName, $header, $records);
  }
public function generateSummaryMembersCsv($node) {
    $summary = $this->getSummary($node);

    $header = [
      $this->t('Title'),
      $this->t('Value'),
    ];

    $records = [
      [$this->t('Total amount of members'), $summary['totalMembers']],
      [$this->t('Registered members by Campaign'), $summary['registeredMembers']],
      [$this->t('Percentage of the registered members'), $summary['percentageMembers'] . '%'],
    ];
    $fileName = 'summary_members_' . date('Y-m-d') . '.csv';

    return $this->createCsvResponse($fileName, $header, $records);
  }
public function generateSummaryMembersCsv ( $ node ) { $ summary = $ this -> getSummary ( $ node ) ; $ header = [ $ this -> t ( 'Title' ) , $ this -> t ( 'Value' ) , ] ; $ records = [ [ $ this -> t ( 'Total amount of members' ) , $ summary [ 'totalMembers' ] ] , [ $ this -> t ( 'Registered members by Campaign' ) , $ summary [ 'registeredMembers' ] ] , [ $ this -> t ( 'Percentage of the registered members' ) , $ summary [ 'percentageMembers' ] . '%' ] , ] ; $ fileName = 'summary_members_' . date ( 'Y-m-d' ) . '.csv' ; return $ this -> createCsvResponse ( $ fileName , $ header , $ records ) ; }
Generate Summary Members CSV.

@param \Drupal\node\NodeInterface|int $node

@return \Symfony\Component\HttpFoundation\Response
Generate Summary Members CSV .