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


PHP Menu::orderBy方法代码示例

本文整理汇总了PHP中app\Menu::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Menu::orderBy方法的具体用法?PHP Menu::orderBy怎么用?PHP Menu::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Menu的用法示例。


在下文中一共展示了Menu::orderBy方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $package_rule = PackageRule::findOrFail($id);
     $menus = Menu::orderBy('name')->notMainCourse()->lists('name', 'id');
     $package = $package_rule->package()->first();
     return view('admin.packages.modals.package_rules._edit_package_rule', compact('package_rule', 'package', 'menus'));
 }
开发者ID:jovvybersamin,项目名称:laravel-edronscateringservices,代码行数:13,代码来源:PackageRuleController.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $allmenus = Menu::orderBy('level', 'ASC')->orderBy('title', 'ASC')->get()->toArray();
     $menus = $this->clubarr($allmenus);
     //\Mesa::prr($menus);
     return view('admin.menu.index')->withMenus($menus)->withPage('menu');
 }
开发者ID:nitin-prodigi,项目名称:mesa,代码行数:12,代码来源:MenuController.php

示例3: showAgenda

 public function showAgenda($slug)
 {
     $data['menuse'] = Menu::orderBy('id')->get()->keyBy('id');
     $data['agenda5'] = Agenda::orderBy('id', 'desc')->take(4)->get();
     $data['footers'] = Footer::orderBy('id')->get()->keyBy('id');
     $data['post'] = Agenda::where('slug', '=', $slug)->firstOrFail();
     return view('agenda.showAgenda')->with('data', $data);
 }
开发者ID:vinnodevega,项目名称:cdc,代码行数:8,代码来源:FrontController.php

示例4: edit

 /**
  * Show the package edit form.
  *
  * @param $id
  * @return \Illuminate\View\View
  */
 public function edit($id)
 {
     $package = Package::findOrFail($id);
     $package_courses = $package->courses()->get();
     $package_rules = $package->rules()->get();
     $menus = Menu::orderBy('name')->where('is_main_course', 0)->lists('name', 'id');
     if (!$menus->count()) {
         $menus->put(0, 'No Menus found.');
     }
     return view('admin.packages.edit', compact('package', 'package_courses', 'package_rules', 'menus'));
 }
开发者ID:jovvybersamin,项目名称:laravel5-edronscateringservices,代码行数:17,代码来源:PackageController.php

示例5: topicAction

 public function topicAction()
 {
     $topic_id = (int) Input::get('id', 0);
     $currtopic = Topic::find($topic_id);
     if ($currtopic->exists()) {
         $menu_id = $currtopic->menu_id;
         $topicarr = Menu::find($menu_id)->topics()->orderBy('level', 'ASC')->orderBy('title', 'ASC')->get()->toArray();
         $topics = $this->clubarr($topicarr);
         $childtopics = $this->findTopics($topics, $topic_id);
         $allmenus = Menu::orderBy('level', 'ASC')->orderBy('title', 'ASC')->get()->toArray();
         $menus = $this->clubarr($allmenus);
         $articles = Menu::find($menu_id)->articles()->join('article_contents', 'article_contents.article_id', '=', 'articles.id')->whereIn('articles.topic_id', $childtopics)->get(['articles.*', 'article_contents.title'])->toArray();
         $viewarr = array('articles' => $articles, 'menus' => $menus, 'menuid' => $menu_id, 'topics' => $topics, 'topicid' => $topic_id);
         \View::share('pagetitle', $currtopic->title);
         return view('civil.menulist')->with($viewarr);
     }
 }
开发者ID:nitin-prodigi,项目名称:mesa,代码行数:17,代码来源:IndexController.php

示例6: indexAction

 public function indexAction()
 {
     $art_id = (int) Input::get('id', 0);
     if ($art_id) {
         $article = Article::find($art_id);
     } else {
         $article = Article::take(1)->skip(0);
     }
     $currarticle = $article->join('article_contents', 'article_contents.article_id', '=', 'articles.id')->get(['articles.*', 'article_contents.title', 'article_contents.content'])->first()->toArray();
     \Mesa::prr($currarticle, 55);
     $topicarr = Menu::find($currarticle['menu_id'])->topics()->orderBy('level', 'ASC')->orderBy('title', 'ASC')->get()->toArray();
     $topics = $this->clubarr($topicarr);
     $allmenus = Menu::orderBy('level', 'ASC')->orderBy('title', 'ASC')->get()->toArray();
     $menus = $this->clubarr($allmenus);
     $viewarr = array('article' => $currarticle, 'topics' => $topics, 'menus' => $menus);
     return view('civil.article.index')->with($viewarr);
 }
开发者ID:nitin-prodigi,项目名称:mesa,代码行数:17,代码来源:ArticleController.php

示例7: index

 /**
  * List all the menus
  *
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $menus = Menu::orderBy('name', 'asc')->get();
     return view('admin.menus.index', compact('menus'));
 }
开发者ID:jovvybersamin,项目名称:laravel-edronscateringservices,代码行数:10,代码来源:MenuController.php

示例8: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $menuitem = MenuItem::findOrFail($id);
     $menus = Menu::orderBy('name')->lists('name', 'id');
     return view('admin.menuitems.edit', compact('menuitem', 'menus'));
 }
开发者ID:jovvybersamin,项目名称:laravel-edronscateringservices,代码行数:12,代码来源:MenuItemController.php

示例9: visi

 public function visi()
 {
     $data['menuse'] = Menu::orderBy('id')->get()->keyBy('id');
     $data['agenda5'] = Agenda::orderBy('id', 'desc')->take(4)->get();
     $data['footers'] = Footer::orderBy('id')->get()->keyBy('id');
     $data['berita-footer'] = Berita::orderBy('id', 'desc')->take(9)->get();
     $data['tentang-unit'] = AdminTentang::orderBy('id')->get()->keyBy('id');
     return view('visi')->with('data', $data);
 }
开发者ID:pramitafirnanda,项目名称:cdc,代码行数:9,代码来源:FrontController.php

示例10: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $elements = Menu::orderBy('id', 'desc')->get();
     return view('admin.admin')->with('elements', $elements);
 }
开发者ID:AleksandarVelk,项目名称:laravel_first_project,代码行数:10,代码来源:AdminController.php


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