Search code examples
phpjoomlapagination

Problems using Joomlas JPagination class. Error 404 page not found


I've created a module for Joomla that fetches some data from a database and creates a table with it. I added JPagination to my module and I got the footer buttons to show and everything.

public function addPagination($params)
{
    $count = $params->get("count");
    $multiPage =  $params->get("multiple_pages");

    //Add controls for changing pages

    if($multiPage)
    {
        jimport('joomla.html.pagination');
        $limitStart = 0;
        $pagination = new JPagination(count($this->vacanciesRows) , $limitStart, $count);

        echo $pagination->getListFooter();
    }
}

but when I click some of the pages (all except the first one) I'm getting error 404. I'm sure I've missed something but I have very little to none experience with Joomla. I'll include pastebins with my helper.php and my mod_xxx_xxx.php


Solution

  • A module can't have a pagination. It has no own URL. Only components have that. If you check the links your module creates, you'll notice that they are invalid. You can try to do Ajax magic but then you need a component providing the data.

    In Joomla only components can react to incoming URLs directly.