Files
nutzwerte_fi4/app/Actions/Generate/Gutachten/Tabelle.php
T
2025-10-13 17:17:30 +02:00

40 lines
902 B
PHP

<?php
namespace App\Actions\Generate\Gutachten;
use App\Utilities\Html;
class Tabelle
{
public static function load($standardtext)
{
$standardtext = strip_tags($standardtext, '<br>');
$standardtext = str_replace('<br>', '§§', $standardtext);
$standardtext = str_replace('<br/>', '§§', $standardtext);
$standardtext = str_replace('<br />', '§§', $standardtext);
$arr = explode('§§', $standardtext);
$html = '<table class="table-striped bl bt m10">';
foreach ($arr as $value) {
$tmp = explode('|', $value);
$tmp[0] = $tmp[0] ?? '';
$tmp[1] = $tmp[1] ?? '';
$html .= '<tr>';
$html .= Html::td($tmp[0], 'br bb');
$html .= Html::td($tmp[1], 'br bb');
$html .= '</tr>';
}
$html .= '</table>';
return $html;
}
}