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


PHP Menu::with方法代码示例

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


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

示例1: __construct

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function __construct()
 {
     $setting = Models\Setting::first();
     $this->data['menu'] = Models\Menu::with('child')->where('level', 0)->get();
     $this->data['berita'] = Models\Berita::orderBy('id_berita', 'desc')->limit(6)->get();
     $this->data['pengumuman'] = Models\Pengumuman::orderBy('tanggal', 'desc')->limit(10)->get();
     $this->data['agenda'] = Models\Agenda::orderBy('tgl_posting', 'desc')->limit(5)->get();
     $this->data['polling'] = Models\Polling::with('jawaban')->where('status', 'Y')->limit(1)->first();
     $this->data['title'] = $setting->title_web;
     $this->data['desc'] = $setting->desc_web;
     $this->data['key'] = $setting->key_web;
     $this->data['logo'] = $setting->logo;
     $this->data['header_img'] = $setting->bg_header;
     $this->data['icon'] = $setting->favicon;
     $this->data['facebook'] = $setting->facebook;
     $this->data['peta_latitude'] = $setting->peta_latitude;
     $this->data['peta_longitude'] = $setting->peta_longitude;
     $this->data['twitter'] = $setting->twitter;
     $this->data['gplus'] = $setting->gplus;
     $this->data['slider_home'] = Models\Berita::orderBy('tanggal', 'desc')->limit(5)->get();
     $this->data['galeri_home'] = Models\Foto::OrderBy('id_foto', 'desc')->paginate(9);
     $this->data['opini_home'] = Models\Berita::where('kategori_berita', 5)->orderBy('id_berita', 'desc')->limit(6)->get();
     $this->data['banner'] = Models\Banner::where('id', 1)->first();
     $this->data['link'] = Models\Link::orderBy('id', 'desc')->limit(5)->get();
     $this->data['publikasi'] = Models\Publikasi::orderBy('id', 'desc')->limit(3)->get();
     $this->data['setting'] = $setting;
 }
开发者ID:brutalcrozt,项目名称:SI-Sekolah-L5,代码行数:32,代码来源:FrontController.php

示例2: __construct

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function __construct()
 {
     $this->data['menu'] = Models\Menu::with('child')->where('level', 0)->get();
     $this->data['berita'] = Models\Berita::orderBy('tanggal', 'desc')->limit(4)->get();
     $this->data['pengumuman'] = Models\Pengumuman::orderBy('tanggal', 'desc')->limit(5)->get();
     $this->data['agenda'] = Models\Agenda::orderBy('tgl_posting', 'desc')->limit(5)->get();
     $this->data['polling'] = Models\Polling::with('jawaban')->where('status', 'Y')->limit(1)->first();
 }
开发者ID:zigunx,项目名称:sis-DEV_old,代码行数:13,代码来源:FrontController.php

示例3: index

 public function index()
 {
     //Get Menu Lists
     if ($this->auth->check()) {
         $status = "logined";
     } else {
         $status = "unlogin";
     }
     $this->login = $status;
     $menu = Menu::with('SubMenu')->get();
     return response()->json($menu);
 }
开发者ID:stevielu,项目名称:MyBlog,代码行数:12,代码来源:MenuController.php

示例4: compose

 /**
  * 将数据绑定到视图。
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     //查询当前登录用户
     $currentRoute = Route::currentRouteName();
     $list = explode('.', $currentRoute);
     $route = '';
     for ($i = 0; $i < count($list) - 1; $i++) {
         if ($i == 0) {
             $route .= $list[$i];
         } else {
             $route .= '.' . $list[$i];
         }
     }
     $route = $route . '.index';
     $breadcrumb = Menu::with('parent')->where('fun_route_name', $route)->first();
     $view->with('breadcrumb', $breadcrumb);
 }
开发者ID:nutsdo,项目名称:nong-store,代码行数:23,代码来源:BreadcrumbComposer.php

示例5: getData

 /**
  * @param Request $request
  *
  * @return mixed
  */
 public function getData(Request $request)
 {
     $id = $request->input('id');
     $menuItem = Menu::with('route')->with('permission')->with('parent')->find($id);
     return $menuItem;
 }
开发者ID:sroutier,项目名称:laravel-5.1-enterprise-starter-kit,代码行数:11,代码来源:MenusController.php


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