當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Post::nextBlogPostUrl方法代碼示例

本文整理匯總了PHP中app\Post::nextBlogPostUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP Post::nextBlogPostUrl方法的具體用法?PHP Post::nextBlogPostUrl怎麽用?PHP Post::nextBlogPostUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Post的用法示例。


在下文中一共展示了Post::nextBlogPostUrl方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: blog_post

 public function blog_post($url)
 {
     $post = Post::whereUrl($url)->first();
     $tags = $post->tags;
     $prev_url = Post::prevBlogPostUrl($post->id);
     $next_url = Post::nextBlogPostUrl($post->id);
     $title = $post->title;
     $description = $post->description;
     $page = 'blog';
     $brands = $this->brands;
     $categories = $this->categories;
     $products = $this->products;
     $data = compact('prev_url', 'next_url', 'tags', 'post', 'title', 'description', 'page', 'brands', 'categories', 'products');
     return view('blog_post', $data);
 }
開發者ID:GanjaGanja,項目名稱:larashop,代碼行數:15,代碼來源:Front.php

示例2: blog_post

 public function blog_post($url)
 {
     $post = \App\Post::where('url', '=', $url)->get();
     $post_id = $post[0]['id'];
     $tags = \App\BlogPostTag::postTags($post_id);
     $previous_url = \App\Post::prevBlogPostUrl($post_id);
     $next_url = \App\Post::nextBlogPostUrl($post_id);
     $data['previous_url'] = $previous_url;
     $data['next_url'] = $next_url;
     $data['tags'] = $tags;
     $data['post'] = $post[0];
     $data['title'] = $post[0]['title'];
     $data['description'] = $post[0]['description'];
     $data['page'] = 'blog';
     $data['brands'] = $this->brands;
     $data['categories'] = $this->categories;
     $data['products'] = $this->products;
     return view('blog_post', array('data' => $data, 'title' => $post[0]['title'], 'description' => $post[0]['description'], 'page' => 'blog', 'brands' => $this->brands, 'categories' => $this->categories, 'products' => $this->products));
     //        $data = compact('prev_url', 'next_url', 'tags', 'post', 'title', 'description', 'page', 'brands', 'categories', 'products');
     //        return $data;
     return view('blog_post', $data);
 }
開發者ID:addeye,項目名稱:laravelshop,代碼行數:22,代碼來源:Front.php


注:本文中的app\Post::nextBlogPostUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。