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