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


PHP Post::prevBlogPostUrl方法代码示例

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


在下文中一共展示了Post::prevBlogPostUrl方法的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::prevBlogPostUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。