/** * @param int $currentPage */ public function index($currentPage = 1) { $this->loadMainData(); $perPage = 50; $offset = $currentPage > 1 ? ($currentPage - 1) * $perPage : 0; $this->data['pageType'] = 'recent'; $this->data['all_tweets'] = true; $filters = $this->data['filters']; $this->data['tweets'] = $this->model->getTweets($filters['own'], $filters['replies'], $filters['retweets'], $filters['favorites'], $offset, $perPage); $this->data['tweetsTotalCount'] = $this->data['totalTweets']; $this->data['pagination'] = $this->paginator->paginate($this->data['config']['system']['baseUrl'], $this->data['tweetsTotalCount'], $currentPage, $perPage); $this->data['title'] = $this->i18n->trans('all_tweets', ['ucf']); $this->data['subTitle'] = $offset ? $this->i18n->trans('page', ['ucf']) . ' ' . $currentPage : ''; $this->render('index.php'); }