本文整理汇总了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'));
}
示例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));
}
示例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');
}
示例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();
}
}
}
示例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');
}
}
示例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;
}
示例7: index
function index()
{
$this->model = Menu::all();
}
示例8: menucreator
public function menucreator()
{
$menu = Menu::all();
return View::make('menucreator')->with("menus", $menu);
}
示例9: index
public function index()
{
return $this->menu->all();
}
示例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));
}