当前位置: 首页>>代码示例>>PHP>>正文


PHP Language::listing方法代码示例

本文整理汇总了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'));
 }
开发者ID:nanaya,项目名称:osu-web,代码行数:15,代码来源:BeatmapController.php

示例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'));
 }
开发者ID:ppy,项目名称:osu-web,代码行数:19,代码来源:BeatmapsetsController.php


注:本文中的app\models\Language::listing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。