本文整理汇总了PHP中app\models\Language::listing方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::listing方法的具体用法?PHP Language::listing怎么用?PHP Language::listing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Language
的用法示例。
在下文中一共展示了Language::listing方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$fractal = new Manager();
$languages = Language::listing();
$genres = Genre::listing();
$data = new Collection(BeatmapSet::listing(), new BeatmapSetTransformer());
$beatmaps = $fractal->createData($data)->toArray();
// temporarily put filters here
$modes = [['id' => null, 'name' => trans('beatmaps.mode.any')], ['id' => Beatmap::OSU, 'name' => trans('beatmaps.mode.osu')], ['id' => Beatmap::TAIKO, 'name' => trans('beatmaps.mode.taiko')], ['id' => Beatmap::FRUITS, 'name' => trans('beatmaps.mode.fruits')], ['id' => Beatmap::MANIA, 'name' => trans('beatmaps.mode.mania')]];
$statuses = [['id' => null, 'name' => trans('beatmaps.status.any')], ['id' => 0, 'name' => trans('beatmaps.status.ranked-approved')], ['id' => 1, 'name' => trans('beatmaps.status.approved')], ['id' => 2, 'name' => trans('beatmaps.status.faves')], ['id' => 3, 'name' => trans('beatmaps.status.modreqs')], ['id' => 4, 'name' => trans('beatmaps.status.pending')], ['id' => 5, 'name' => trans('beatmaps.status.graveyard')], ['id' => 6, 'name' => trans('beatmaps.status.my-maps')]];
$extras = [['id' => 0, 'name' => trans('beatmaps.extra.video')], ['id' => 1, 'name' => trans('beatmaps.extra.storyboard')]];
$ranks = [['id' => 'XH', 'name' => trans('beatmaps.rank.silver-ss')], ['id' => 'X', 'name' => trans('beatmaps.rank.ss')], ['id' => 'SH', 'name' => trans('beatmaps.rank.silver-s')], ['id' => 'S', 'name' => trans('beatmaps.rank.s')], ['id' => 'A', 'name' => trans('beatmaps.rank.a')], ['id' => 'B', 'name' => trans('beatmaps.rank.b')], ['id' => 'C', 'name' => trans('beatmaps.rank.c')], ['id' => 'D', 'name' => trans('beatmaps.rank.d')]];
$filters = ['data' => compact('modes', 'statuses', 'genres', 'languages', 'extras', 'ranks')];
return view('beatmaps.index', compact('filters', 'beatmaps'));
}
示例2: index
public function index()
{
$languages = Language::listing();
$genres = Genre::listing();
$beatmaps = json_collection(Beatmapset::listing(), new BeatmapsetTransformer(), 'beatmaps');
// temporarily put filters here
$modes = [['id' => null, 'name' => trans('beatmaps.mode.any')]];
foreach (Beatmap::MODES as $name => $id) {
$modes[] = ['id' => (string) $id, 'name' => trans("beatmaps.mode.{$name}")];
}
$statuses = [['id' => '7', 'name' => trans('beatmaps.status.any')], ['id' => '0', 'name' => trans('beatmaps.status.ranked-approved')], ['id' => '1', 'name' => trans('beatmaps.status.approved')], ['id' => '8', 'name' => trans('beatmaps.status.loved')], ['id' => '2', 'name' => trans('beatmaps.status.faves')], ['id' => '3', 'name' => trans('beatmaps.status.modreqs')], ['id' => '4', 'name' => trans('beatmaps.status.pending')], ['id' => '5', 'name' => trans('beatmaps.status.graveyard')], ['id' => '6', 'name' => trans('beatmaps.status.my-maps')]];
$extras = [['id' => '0', 'name' => trans('beatmaps.extra.video')], ['id' => '1', 'name' => trans('beatmaps.extra.storyboard')]];
$ranks = [];
foreach (['XH', 'X', 'SH', 'S', 'A', 'B', 'C', 'D'] as $rank) {
$ranks[] = ['id' => $rank, 'name' => trans("beatmaps.rank.{$rank}")];
}
$filters = compact('modes', 'statuses', 'genres', 'languages', 'extras', 'ranks');
return view('beatmaps.index', compact('filters', 'beatmaps'));
}