本文整理汇总了PHP中Menu::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Menu::orderBy方法的具体用法?PHP Menu::orderBy怎么用?PHP Menu::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu::orderBy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIndex
public function getIndex()
{
$items = Menu::orderBy('order')->get();
$menu = new Menu();
$menu = $menu->getHTML($items);
$this->layout->content = View::make('admin.menu.builder', array('items' => $items, 'menu' => $menu));
}
示例2: home
public function home()
{
$link_pages = OnlineOrder::orderBy('id', 'ASC')->get();
$slider_pages = Slider::orderBy('position', 'ASC')->get();
$menu_sliders = Menu::orderBy('id', 'ASC')->get();
$menu_pdf = Menupdf::orderBy('id', 'ASC')->get();
return View::make('pages.index', ['slider_pages' => $slider_pages, 'link_pages' => $link_pages, 'menu_sliders' => $menu_sliders, 'menu_pdf' => $menu_pdf]);
}
示例3: index
public function index()
{
if (\Input::get('theme')) {
\Cookie::queue('theme', \Input::get('theme'), 100);
return Redirect::to('/')->withCookie(cookie('theme', \Input::get('theme'), 100));
}
$data = array('videos' => Video::where('active', '=', '1')->orderBy('created_at', 'DESC')->simplePaginate($this->videos_per_page), 'current_page' => 1, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/videos', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
//dd($data['videos']);
return View::make('Theme::home', $data);
}
示例4: index
public function index()
{
$search_value = Input::get('value');
if (empty($search_value)) {
return Redirect::to('/');
}
$videos = Video::where('active', '=', 1)->where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->get();
$posts = Post::where('active', '=', 1)->where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->get();
$data = array('videos' => $videos, 'posts' => $posts, 'search_value' => $search_value, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
return View::make('Theme::search-list', $data);
}
示例5: category
public function category($category)
{
$page = Input::get('page');
if (!empty($page)) {
$page = Input::get('page');
} else {
$page = 1;
}
$cat = PostCategory::where('slug', '=', $category)->first();
$data = array('posts' => Post::where('active', '=', '1')->where('post_category_id', '=', $cat->id)->orderBy('created_at', 'DESC')->simplePaginate($this->posts_per_page), 'current_page' => $page, 'category' => $cat, 'page_title' => 'Posts - ' . $cat->name, 'page_description' => 'Page ' . $page, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/posts/category/' . $category, 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
return View::make('Theme::post-list', $data);
}
示例6: store
public function store()
{
$input = Input::all();
$last_menu_item = Menu::orderBy('order', 'DESC')->first();
if (isset($last_menu_item->order)) {
$new_menu_order = intval($last_menu_item->order) + 1;
} else {
$new_menu_order = 1;
}
$input['order'] = $new_menu_order;
$menu = Menu::create($input);
if (isset($menu->id)) {
return Redirect::to('admin/menu')->with(array('note' => 'Successfully Added New Menu Item', 'note_type' => 'success'));
}
}
示例7: show_favorites
public function show_favorites()
{
if (!Auth::guest()) {
$page = Input::get('page');
if (empty($page)) {
$page = 1;
}
$favorites = Favorite::where('user_id', '=', Auth::user()->id)->orderBy('created_at', 'desc')->get();
$favorite_array = array();
foreach ($favorites as $key => $fave) {
array_push($favorite_array, $fave->video_id);
}
$videos = Video::where('active', '=', '1')->whereIn('id', $favorite_array)->paginate(12);
$data = array('videos' => $videos, 'page_title' => ucfirst(Auth::user()->username) . '\'s Favorite Videos', 'current_page' => $page, 'page_description' => 'Page ' . $page, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/favorites', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
return View::make('Theme::video-list', $data);
} else {
return Redirect::to('videos');
}
}
示例8: index
public function index()
{
$data['data'] = Menu::orderBy('menu_id', 'desc')->paginate(9);
return View::make('guest/content/customerMenu/index', $data)->with("titleTable", "Thực đơn tuần")->with("flash_success", "Đăng ký ăn thành công! Xem lịch ăn của bạn!");
}
示例9:
<?php
$menu = Menu::orderBy('order', 'ASC')->get();
include 'includes/header.php';
?>
<div class="container">
<h3>(404) Not found</h3>
<p>Sorry, the page you are looking for does not exist.</p>
<a href="<?php
echo URL::to('/');
?>
">Click here to visit the homepage</a>
</div>
<br /><br />
<?php
include 'includes/footer.php';
示例10: get_data
function get_data()
{
return Menu::orderBy('sort', 'ASC')->orderBy('id', 'ASC')->where('status', 1)->where('prnt', null)->get();
}
示例11: index
public function index()
{
$menus = Menu::orderBy('order')->get();
return View::make("admin.menu.list", array("menus" => $menus));
}
示例12: password_reset_token
public function password_reset_token($token)
{
$data = array('type' => 'reset_password', 'token' => $token, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'payment_settings' => PaymentSetting::first(), 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
return View::make('Theme::auth', $data);
}
示例13: pages
public function pages()
{
$data = array('pages' => Page::orderBy('created_at', 'DESC')->get(), 'page_title' => 'Pages', 'page_description' => 'All Pages', 'menu' => Menu::orderBy('order', 'ASC')->get(), 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
return View::make('Theme::page-list', $data);
}
示例14: 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));
}
示例15: renew
public function renew($username)
{
$user = User::where('username', '=', $username)->first();
$payment_settings = PaymentSetting::first();
if ($payment_settings->live_mode) {
User::setStripeKey($payment_settings->live_secret_key);
} else {
User::setStripeKey($payment_settings->test_secret_key);
}
if (Auth::user()->username == $username) {
$data = array('user' => $user, 'post_route' => URL::to('user') . '/' . $user->username . '/update', 'type' => 'renew_subscription', 'menu' => Menu::orderBy('order', 'ASC')->get(), 'payment_settings' => $payment_settings, 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
return View::make('Theme::user', $data);
} else {
return Redirect::to('/');
}
}