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


PHP models\Menu类代码示例

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


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

示例1: __construct

 /**
  * Create a new controller instance.
  *
  * @return void
  */
 public function __construct(LaravelFacebookSdk $fb, Menu $menu, ProjectRepository $project_repo)
 {
     $this->middleware('auth');
     $this->menuItems = $menu->where('active', '1')->orderBy('weight', 'asc')->get();
     $this->login_url = $fb->getLoginUrl(['email']);
     $this->project_repo = $project_repo;
 }
开发者ID:udayc,项目名称:travel,代码行数:12,代码来源:CheckoutController.php

示例2: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $menu = new Menu();
     $menu->event_id = 1;
     $menu->menu_name = "Test Menu";
     $menu->save();
 }
开发者ID:rob-meh,项目名称:table-seater,代码行数:12,代码来源:MenuSeeder.php

示例3: __construct

 /**
  * Create a new authentication controller instance.
  *
  * @param  \Illuminate\Contracts\Auth\Guard  $auth
  * @param  \Illuminate\Contracts\Auth\Registrar  $registrar
  * @return void
  */
 public function __construct(Guard $auth, Registrar $registrar, Menu $menu)
 {
     $this->auth = $auth;
     $this->registrar = $registrar;
     $this->menuItems = $menu->where('active', '1')->orderBy('weight', 'asc')->get();
     $this->middleware('guest', ['except' => 'getLogout']);
 }
开发者ID:udayc,项目名称:travel,代码行数:14,代码来源:AuthController.php

示例4: __construct

 public function __construct(Menu $menuModel, Slider $slider)
 {
     $this->data['menu']['left'] = $menuModel->getLeftMenu();
     $this->data['menu']['right'] = $menuModel->getRightMenu();
     $this->data['slider'] = $slider->getActive();
     $URL = $_SERVER['REQUEST_URI'];
     $this->data['url_lang'] = substr($URL, 1, 2);
 }
开发者ID:bogdan8,项目名称:iaravel5,代码行数:8,代码来源:MainController.php

示例5: __construct

 /**
  * Create a new controller instance.
  *
  * @return void
  */
 public function __construct(LaravelFacebookSdk $fb, Menu $menu, UserRepository $userrepo, ProjectRepository $project_repo)
 {
     $this->middleware('auth');
     $this->menuItems = $menu->where('active', '1')->orderBy('weight', 'asc')->get();
     $this->login_url = $fb->getLoginUrl(['email']);
     $this->userrepo = $userrepo;
     $this->project_repo = $project_repo;
     $id = Auth::user()->id;
     $userProfile = Profile::where('user_id', $id)->first();
     $errorNotification = '0';
     if ($userProfile->f_name == '' || $userProfile->l_name == '' || $userProfile->dob == '0000-00-00' || $userProfile->about_me == '' || $userProfile->first_address == '' || $userProfile->alternate_address == '' || $userProfile->state == '' || $userProfile->zipcode == '' || $userProfile->user_avtar == '') {
         $errorNotification = '1';
     }
     $this->errorNotification = $errorNotification;
 }
开发者ID:udayc,项目名称:travel,代码行数:20,代码来源:HomeController.php

示例6: update

 public function update(Request $request, $menuId)
 {
     $info = $request->only('info');
     $menu = Menu::find($menuId);
     $menu->update($info['info']);
     return view('message', ['msg' => '操作成功', 'redirect' => route('menus.index')]);
 }
开发者ID:ruolinn,项目名称:lcms,代码行数:7,代码来源:MenusController.php

示例7: __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

示例8: boot

 public function boot()
 {
     view()->composer('*', function ($view) {
         $menuId = request()->get('menuid');
         $routeName = app('router')->currentRouteName();
         if (empty($menuId)) {
             $menuId = app('menu')->select('id')->where('route', '=', $routeName)->first()['id'];
         }
         $params = ['submenus' => [], 'route_name' => $routeName, 'menuid' => $menuId];
         if (!empty($menuId)) {
             $menus = Menu::all();
             $submenus = [];
             foreach ($menus as $menu) {
                 if ($menu['parentid'] == $menuId) {
                     $submenus[] = $menu;
                 }
                 if ($menu['id'] == $menuId) {
                     $p = $menu;
                 }
             }
             array_unshift($submenus, $p);
             $params['submenus'] = $submenus;
         }
         $view->with($params);
     });
 }
开发者ID:ruolinn,项目名称:lcms,代码行数:26,代码来源:ComposerServiceProvider.php

示例9: compose

 /**
  * 将数据绑定到视图。
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     //查询当前登录用户
     $admin = Auth::guard('admin')->user();
     if ($admin->admin_name == 'admin') {
         $menus = Menu::orderBy('sort', 'ASC')->get()->toTree();
     } else {
         if ($admin->role) {
             $ids = DB::table('sys_role_function')->where('sys_role_id', $admin->role[0]->id)->pluck('sys_fun_id');
             $menus = Menu::orderBy('sort', 'ASC')->whereIn('id', $ids)->get()->toTree();
         }
     }
     $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';
     $view->with('currentRoute', $route)->with('trees', $menus);
 }
开发者ID:nutsdo,项目名称:nong-store,代码行数:31,代码来源:CommonComposer.php

示例10: run

 public function run()
 {
     $menu = Menu::find()->where(['position' => 'bottom'])->one();
     $p = explode(',', $menu->content);
     $model = Page::find()->where(['id' => $p])->all();
     return $this->render('links', ['pages' => $model]);
 }
开发者ID:sanmaowang,项目名称:ycjl,代码行数:7,代码来源:Links.php

示例11: getChildMenu

 public static function getChildMenu($ParentId, $ParentLabel)
 {
     $menuData = Menu::find()->where(['ismenu' => TRUE, 'status' => TRUE, 'parentid' => $ParentId, 'isweb' => FALSE])->orderBy('orderby')->all();
     $submenu = array();
     $menu = array();
     if (!empty($menuData)) {
         foreach ($menuData as $mKey => $mValue) {
             $menu['label'] = Html::tag('i', '', ['class' => $mValue['labelicon']]) . Html::encode($mValue['label']);
             $urlArray = [$mValue['module'], $mValue['controller'], $mValue['action']];
             $menu['url'] = \Yii::$app->urlManager->createUrl(implode('/', $urlArray));
             $class = '';
             if (\Yii::$app->controller->id == $urlArray[1] && \Yii::$app->controller->action->id == $urlArray[2]) {
                 $class = 'active';
                 \Yii::$app->params['breadcrumbs'][] = $ParentLabel;
                 \Yii::$app->params['breadcrumbs'][] = $mValue['label'];
             }
             $menu['options'] = ['class' => $class];
             $submenu[$mValue['orderby']] = $menu;
             unset($menu, $urlArray);
         }
         // $submenu['options'] = ['class' => 'children'];
     }
     return $submenu;
     //, 'options' => ['class' => 'children']];
 }
开发者ID:kurmidev,项目名称:ims,代码行数:25,代码来源:MenuHelper.php

示例12: destroy

 public function destroy($id)
 {
     //
     $data = Menu::find($id);
     if ($data->delete()) {
         return response()->json(array('success' => TRUE, 'msg' => 'Data Berhasil Dihapus'));
     }
 }
开发者ID:brutalcrozt,项目名称:SI-Sekolah-L5,代码行数:8,代码来源:MenuController.php

示例13: content

 public function content($slug)
 {
     $menu_item = Menu::where('url', $slug);
     if ($menu_item->count()) {
         return view('home.content', ['menu_item' => $menu_item->first()]);
     }
     return view('errors.404');
 }
开发者ID:venomir,项目名称:venomir.com,代码行数:8,代码来源:MenuController.php

示例14: __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

示例15: findModel

 protected function findModel($id)
 {
     if (($model = Menu::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
开发者ID:phucnv206,项目名称:pharma,代码行数:8,代码来源:MenuController.php


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