listPosts() public method

Get the most recent posts
public listPosts ( boolean $showAll = false, integer $offset, integer $limit = 20 ) : array
$showAll boolean
$offset integer
$limit integer
return array
Ejemplo n.º 1
0
 /**
  * List the blog posts
  *
  * @route blog/post{_page}
  * @param string $page
  */
 public function listPosts($page = null)
 {
     list($offset, $limit) = $this->getOffsetAndLimit($page);
     $this->lens('blog/posts', ['active_link' => 'bridge-link-blog-posts', 'blog_posts' => $this->blog->listPosts($this->isSuperUser(), $offset, $limit), 'pagination' => ['base' => $this->airship_cabin_prefix . '/blog/post', 'suffix' => '/', 'count' => $this->blog->numPosts(), 'page' => (int) \ceil($offset / ($limit ?? 1)) + 1, 'per_page' => $limit]]);
 }