. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Elements; use Fisharebest\Webtrees\Tree; use function e; use function view; /** * NAME_PERSONAL := {Size=1:120} * [ | , ] * Given name or earned name. Different given names are separated by a comma. */ class NamePieceGiven extends AbstractElement { protected const MAX_LENGTH = 120; /** * An edit control for this data. * * @param string $id * @param string $name * @param string $value * @param Tree $tree * * @return string */ public function edit(string $id, string $name, string $value, Tree $tree): string { return '
' . '' . view('edit/input-addon-keyboard', ['id' => $id]) . '
'; } /** * Display the value of this type of element. * * @param string $value * @param Tree $tree * * @return string */ public function value(string $value, Tree $tree): string { return '' . preg_replace('/(\S*)\*/', '\\1', e($value)) . ''; } }