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


PHP Menu::getCache方法代码示例

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


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

示例1: errors

 public static function errors($code = 404, $title = '', $message = '')
 {
     $ajax = Request::ajax();
     if (!$code) {
         $code = 500;
         $title = 'Internal Server Error';
         $message = 'We got problems over here. Please try again later!';
     } else {
         if ($code == 404) {
             $title = 'Oops! You\'re lost.';
             $message = 'We can not find the page you\'re looking for.';
         }
     }
     if (Request::ajax()) {
         return Response::json(['error' => ['message' => $message]], $code);
     }
     $arrData = [];
     $arrData['content'] = View::make('frontend.errors.error')->with(['title' => $title, 'code' => $code, 'message' => $message]);
     $arrData['metaInfo'] = Home::getMetaInfo();
     $arrData['metaInfo']['meta_title'] = $title;
     $arrData['types'] = Home::getTypes();
     $arrData['categories'] = Home::getCategories();
     $arrData['headerMenu'] = Menu::getCache(['header' => true]);
     return View::make('frontend.layout.default')->with($arrData);
 }
开发者ID:nguyendaivu,项目名称:imagestock,代码行数:25,代码来源:BaseController.php

示例2: errors

 public static function errors($code = 404, $title = 'Oops! You\'re lost.', $message = '')
 {
     $ajax = Request::ajax();
     if ($code == 404) {
         $title = 'Oops! You\'re lost.';
         $message = 'We can not find the page you\'re looking for.';
         if (!$ajax) {
             $message .= '<br/><a href="' . URL . '/admin">Return home </a>';
         }
     } else {
         if ($code == 403) {
             $title = 'Oops! You are not allowed to go to this page.';
             $message = 'Please check your permission.';
             if (!$ajax) {
                 $message .= '<a href="' . URL . '/admin">
                     Return home </a>';
             }
         } else {
             if (!$code || $code == 500) {
                 $code = 500;
                 if (empty($title)) {
                     $title = 'Internal Server Error';
                 }
                 if (empty($message)) {
                     $message = 'We got problems over here. Please try again later!';
                 }
             }
         }
     }
     if ($ajax) {
         return Response::json(['error' => ['title' => $title, 'message' => $message]], $code);
     }
     return View::make('admin.errors.error')->with(['title' => $title, 'code' => $code, 'message' => $message, 'admin' => Auth::admin()->get(), 'sideMenu' => Menu::getCache(['sidebar' => true]), 'currentTheme' => Cookie::has('theme') ? Cookie::get('theme') : 'default']);
 }
开发者ID:nguyendaivu,项目名称:imagestock,代码行数:34,代码来源:AdminController.php

示例3: deleteMenu

 public function deleteMenu($id)
 {
     $arrReturn = ['status' => 'error', 'message' => 'There is something wrong. Please refresh and try again.'];
     $menu = Menu::find($id);
     if (!is_null($menu)) {
         $name = $menu->name;
         $type = $menu->type;
         if (Permission::can($this->layout->admin, "menus{$type}_delete_all")) {
             self::deleteRecursiveMenu($menu->id, $menu);
             $arrReturn['status'] = 'success';
             $arrReturn['message'] = "<b>{$name}</b> menu has been deleted.";
             if ($menu->destroy($menu->id)) {
                 if ($type == 'backend') {
                     $sidebar = Menu::getCache(['sidebar' => true]);
                     $arrReturn['sidebar'] = $sidebar;
                 }
             }
         } else {
             $arrReturn['message'] = 'You do not have permission to delete menu.';
         }
     }
     $response = Response::json($arrReturn);
     $response->header('Content-Type', 'application/json');
     return $response;
 }
开发者ID:nguyendaivu,项目名称:imagestock,代码行数:25,代码来源:MenusController.php


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