You are here

public function TableYamlFormExporter::writeSubmission in YAML Form 8

Write submission to export.

Parameters

\Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission: A form submission.

Overrides YamlFormExporterBase::writeSubmission

File

src/Plugin/YamlFormExporter/TableYamlFormExporter.php, line 93

Class

TableYamlFormExporter
Defines a HTML table exporter.

Namespace

Drupal\yamlform\Plugin\YamlFormExporter

Code

public function writeSubmission(YamlFormSubmissionInterface $yamlform_submission) {
  $record = $this
    ->buildRecord($yamlform_submission);
  $file_handle = $this->fileHandle;
  $row = [];
  foreach ($record as $item) {
    $row[] = '<td>' . htmlentities($item) . '</td>';
  }
  fwrite($file_handle, '<tr valign="top">');
  fwrite($file_handle, implode("\n", $row));
  fwrite($file_handle, '</tr>');
}