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


PHP Menu::all方法代码示例

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


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

示例1: show

 /**
  * Display the specified resource.
  * GET /menus/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $menus = Menu::all();
     $menu = Menu::find($id);
     // dd($menu);
     return View::make('menus.index', compact('menus', 'menu'));
 }
开发者ID:arbuuuud,项目名称:gnt-aops,代码行数:14,代码来源:MenusController.php

示例2: search

 public function search(DanhmucphonghopSearchIndexRequest $query)
 {
     $menus = Menu::all();
     $querys = $query->input('query');
     $danhmucphonghops = Danhmucphonghop::where('name', 'LIKE', '%' . $querys . '%')->orderBy('name')->paginate(10);
     if ($danhmucphonghops == NULL) {
         $danhmucphonghops = 'Không tìm thấy';
     }
     return view('danhmucphonghop.index')->with(array('danhmucphonghops' => $danhmucphonghops, 'menus' => $this->menus));
 }
开发者ID:thaigialai1987,项目名称:qlcv,代码行数:10,代码来源:DanhmucphonghopController.php

示例3: configure

	public function configure($widgetParams, $orient)
	{
		$this->menu = $widgetParams['menu'];
		$menus = Menu::all();
		$textMenus = array();
		foreach ($menus as $menu)
		{
			$textMenus[$menu->name] = $menu->name;
		}
		$this->menus = $textMenus;
		return $this->renderConfigure('aside/menu-configure');
	}
开发者ID:nathansamson,项目名称:CoOrg,代码行数:12,代码来源:menu.aside.php

示例4: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('menus')->truncate();
     $menu = array(array('id' => 1, 'descricao' => 'Usuarios', 'url' => '/users', 'icone' => 'ion ion-person-add', 'indice' => '', 'menu_pai' => null, 'created_at' => 'now()', 'updated_at' => 'now()', 'color' => 'blue'), array('id' => 28, 'descricao' => 'Taxas', 'url' => '/taxa', 'icone' => 'fa fa-money', 'indice' => null, 'menu_pai' => null, 'created_at' => 'now()', 'updated_at' => 'now()', 'color' => 'black'), array('id' => 29, 'descricao' => 'Corretor', 'url' => 'corretors', 'icone' => 'glyphicon glyphicon-user', 'indice' => null, 'menu_pai' => 28, 'created_at' => 'now()', 'updated_at' => 'now()', 'color' => null), array('id' => 30, 'descricao' => 'Itens', 'url' => 'itens', 'icone' => 'glyphicon glyphicon-ok', 'indice' => null, 'menu_pai' => 28, 'created_at' => 'now()', 'updated_at' => 'now()', 'color' => null), array('id' => 31, 'descricao' => 'Taxas', 'url' => 'taxas', 'icone' => 'glyphicon glyphicon-signal', 'indice' => null, 'menu_pai' => 28, 'created_at' => 'now()', 'updated_at' => 'now()', 'color' => null), array('id' => 32, 'descricao' => 'Relatorios', 'url' => 'relatorios', 'icone' => 'glyphicon glyphicon-list-alt', 'indice' => null, 'menu_pai' => 28, 'created_at' => 'now()', 'updated_at' => 'now()', 'color' => null));
     DB::table('menus')->insert($menu);
     $menu = Menu::all();
     foreach ($menu as $value) {
         $res = UsuarioPermissao::where('usuario_id', '=', 1)->where('menu_id', '=', $value->id)->count();
         if ($res == 0) {
             $permissao = new UsuarioPermissao();
             $permissao->usuario_id = 1;
             $permissao->menu_id = $value->id;
             $permissao->save();
         }
     }
 }
开发者ID:kuell,项目名称:buriti,代码行数:21,代码来源:MenuTableSeeder.php

示例5: save

	public function save($name, $description)
	{
		$menu = new Menu;
		$menu->name = $name;
		$menu->description = $description;
		
		try
		{
			$menu->save();
			$this->notice(t('Menu created'));
			$this->redirect('admin', 'menu', 'edit', $name);
		}
		catch (ValidationException $e)
		{
			$this->error(t('Menu was not saved'));
			$this->menus = Menu::all();
			$this->newMenu = $menu;
			$this->render('index');
		}
	}
开发者ID:nathansamson,项目名称:CoOrg,代码行数:20,代码来源:admin.menu.controller.php

示例6: order

 public function order()
 {
     $menu_item_order = json_decode(Input::get('order'));
     $post_categories = Menu::all();
     $order = 1;
     foreach ($menu_item_order as $menu_level_1) {
         $level1 = Menu::find($menu_level_1->id);
         if ($level1->id) {
             $level1->order = $order;
             $level1->parent_id = NULL;
             $level1->save();
             $order += 1;
         }
         if (isset($menu_level_1->children)) {
             $children_level_1 = $menu_level_1->children;
             foreach ($children_level_1 as $menu_level_2) {
                 $level2 = Menu::find($menu_level_2->id);
                 if ($level2->id) {
                     $level2->order = $order;
                     $level2->parent_id = $level1->id;
                     $level2->save();
                     $order += 1;
                 }
                 if (isset($menu_level_2->children)) {
                     $children_level_2 = $menu_level_2->children;
                     foreach ($children_level_2 as $menu_level_3) {
                         $level3 = Menu::find($menu_level_3->id);
                         if ($level3->id) {
                             $level3->order = $order;
                             $level3->parent_id = $level2->id;
                             $level3->save();
                             $order += 1;
                         }
                     }
                 }
             }
         }
     }
     return 1;
 }
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:40,代码来源:AdminMenuController.php

示例7: index

 function index()
 {
     $this->model = Menu::all();
 }
开发者ID:bparks,项目名称:pails-menu,代码行数:4,代码来源:MenuController.php

示例8: menucreator

 public function menucreator()
 {
     $menu = Menu::all();
     return View::make('menucreator')->with("menus", $menu);
 }
开发者ID:tvad911,项目名称:laravel-wordpress-menu-clone,代码行数:5,代码来源:HomeController.php

示例9: index

 public function index()
 {
     return $this->menu->all();
 }
开发者ID:rtablada,项目名称:student-grading,代码行数:4,代码来源:MenusController.php

示例10: index

 /**
  * List all the online links
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $menu_pages = Menu::orderBy('id')->get();
     $total_pages = Menu::all()->count();
     return View::make('admin.menu.index', array('menu_pages' => $menu_pages, 'total' => $total_pages));
 }
开发者ID:mariotr83,项目名称:sushiito,代码行数:10,代码来源:MenuController.php


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