standings((int) $params['id']); header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename="tabla-posiciones.csv"'); $out = fopen('php://output', 'w'); fputcsv($out, ['Equipo', 'PJ', 'G', 'P', 'SF', 'SC', 'Puntos']); foreach ($rows as $row) { fputcsv($out, [$row['name'], $row['played'], $row['won'], $row['lost'], $row['sets_for'], $row['sets_against'], $row['points']]); } } public function standingsPdf(array $params): void { $rows = (new ScoreSheetService())->standings((int) $params['id']); header('Content-Type: text/html; charset=utf-8'); echo '
Usar imprimir / guardar como PDF desde el navegador.
| Equipo | PJ | G | P | SF | SC | Pts |
|---|---|---|---|---|---|---|
| %s | %s | %s | %s | %s | %s | %s |