mercredi 29 juin 2016

How do I fix a pagination issue with Cake PHP where clicking "next page" displays the same news articles?

This webpage I've been working on (BMAMedia.com/news) displays 20 articles at a time. When "Next Page" is clicked, the site continues to display the same articles every time. My guess would be the issue lies in one of these three functions:

function index() {
    $this->News->recursive = 0;
    $this->set('news', $this->paginate());
}

function editlist() {   
    $this->layout = 'adminlayout';
    $this->News->recursive = 0;
    $this->set('news', $this->paginate());
}

function headlines() {
    $news = $this->paginate();
    if(isset($this->params['requested'])) {
        return $news;
    }
    $this->News->recursive = 0;
    $this->set('news', $news);
}

If someone could please help me with this that would be great because I'm not sure where to go from here and I've researched for hours with no luck.




Aucun commentaire:

Enregistrer un commentaire