本文整理汇总了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);
}
示例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']);
}
示例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;
}