/** * Listen the home petition * * @param array $_datas * @return array JSON */ private function jsonShowMore($_datas) { $postsWhereKey = $_datas['postsWhereKey']; $postsWhereValue = $_datas['postsWhereValue']; $limit = $_datas['limit']; $offset = $_datas['offset']; $getPostsBy = Post::getFuncBy($postsWhereKey); $posts = $getPostsBy($postsWhereValue, $limit, $offset); $content = $this->render('home/_all_posts', ['posts' => $posts]); $json['limit'] = count($posts); $json['content'] = $content; $json['code'] = KeysRequest::OK; return $json; }