• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP models\Menu类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: update

 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(Request $request, $eventSlug, $menuId)
 {
     $this->menu = Menu::findOrFail($menuId);
     $this->menu->fill($request->input());
     $this->menu->save();
     return redirect()->back()->with('message', 'Menu name updated');
     //Do this homie
 }
开发者ID:rob-meh,项目名称:weddinger,代码行数:15,代码来源:MenuController.php


示例17: postDestroy

 public function postDestroy()
 {
     $menu = Menu::find(Input::get('id'));
     if ($menu) {
         $menu->delete();
         return Redirect::back()->with('message', 'Элемент меню удален');
     }
     return Redirect::back()->with('message', "Ошибка");
 }
开发者ID:venomir,项目名称:tc,代码行数:9,代码来源:MenuController.php


示例18: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Menu::create(['key' => '', 'name' => 'Главная', 'sort' => '1']);
     Menu::create(['key' => 'catalog', 'name' => 'Каталог', 'sort' => '2']);
     Menu::create(['key' => 'delivery', 'name' => 'Доставка и оплата', 'sort' => '3']);
     Menu::create(['key' => 'orderFurniture', 'name' => 'Мебель на заказ', 'sort' => '4']);
     Menu::create(['key' => 'wholesalers', 'name' => 'Оптовикам', 'sort' => '5']);
     Menu::create(['key' => 'contacts', 'name' => 'Контакты', 'sort' => '6']);
 }
开发者ID:pechatny,项目名称:kolizej,代码行数:14,代码来源:MenuTableSeeder.php


示例19: getCategoryOptions

 /**
  * @param Category $except
  *
  * @return CategoriesController
  */
 protected function getCategoryOptions($except = null)
 {
     /** @var \Kalnoy\Nestedset\QueryBuilder $query */
     $query = Menu::select('id', 'fun_name')->withDepth();
     if ($except) {
         $query->whereNotDescendantOf($except)->where('id', '<>', $except->id);
     }
     return $this->makeOptions($query->get());
 }
开发者ID:nutsdo,项目名称:nong-store,代码行数:14,代码来源:MenuController.php


示例20: validateUrl

 public function validateUrl($attribute, $params)
 {
     $row = Menu::findOne(['url' => $this->url]);
     if ($row) {
         //if ($row->id != $this->post_id){
         $this->addError($attribute, 'Пункт меню с таким URI уже существует.');
         //}
     }
 }
开发者ID:hysdop,项目名称:YobaCMS,代码行数:9,代码来源:MenuForm.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP models\News类代码示例发布时间:2022-05-23
下一篇:
PHP models\LoginForm类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap