當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。