Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GedcomRecord format: Replace HTML in class by view #4660

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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() ?>