listComments() public method

List comments
public listComments ( integer $offset, integer $limit = 20 ) : array
$offset integer
$limit integer
return array
Ejemplo n.º 1
0
 /**
  * @route blog/comments{_page}
  * @param string $page
  */
 public function listComments($page = null)
 {
     if (!$this->can('publish')) {
         \Airship\redirect($this->airship_cabin_prefix . '/blog');
     }
     list($offset, $limit) = $this->getOffsetAndLimit($page);
     $this->lens('blog/comments', ['active_link' => 'bridge-link-blog-comments', 'comments' => $this->blog->listComments($offset, $limit), 'pagination' => ['base' => $this->airship_cabin_prefix . '/blog/post', 'suffix' => '/', 'count' => $this->blog->numComments(), 'page' => (int) \ceil($offset / ($limit ?? 1)) + 1, 'per_page' => $limit]]);
 }