Skip to content

Commit

Permalink
GedcomRecord format: Replace HTML in class by view
Browse files Browse the repository at this point in the history
  • Loading branch information
jon48 committed Dec 13, 2022
1 parent a046a25 commit fef9c8e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
7 changes: 1 addition & 6 deletions app/GedcomRecord.php
Expand Up @@ -501,12 +501,7 @@ public function alternateName(): ?string
*/
public function formatList(): string
{
$html = '<a href="' . e($this->url()) . '">';
$html .= '<b>' . $this->fullName() . '</b>';
$html .= '</a>';
$html .= $this->formatListDetails();

return $html;
return view('record-list-info', ['record' => $this]);
}

/**
Expand Down
14 changes: 14 additions & 0 deletions resources/views/record-list-info.phtml
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);


/**
* @var GedcomRecord $record
*/

?>
<a href="<?= e($record->url()) ?>">
<strong><?= $record->fullName() ?></strong>
</a>
<?= $record->formatListDetails() ?>

0 comments on commit fef9c8e

Please sign in to comment.