official additioin + zero bonus

This commit is contained in:
xiaomlove
2022-09-25 16:33:52 +08:00
parent e94c7340e4
commit 3f559de57f
21 changed files with 206 additions and 55 deletions

View File

@@ -154,5 +154,20 @@ class TagRepository extends BaseRepository
return self::$allTags;
}
public function buildSelect($name, $value): string
{
$list = $this->listAll();
$select = sprintf('<select name="%s"><option value="">%s</option>', $name, nexus_trans('nexus.select_one_please'));
foreach ($list as $item) {
$selected = '';
if ($item->id == $value) {
$selected = ' selected';
}
$select .= sprintf('<option value="%s"%s>%s</option>', $item->id, $selected, $item->name);
}
$select .= '</select>';
return $select;
}
}