我为Joomla创建了一个模块,它从数据库中获取一些数据并用它创建一个表。我将JPagination添加到我的模块中,然后我会显示页脚按钮以显示所有内容。
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();
}
}
但是当我点击一些页面时(除了第一个页面之外的所有页面)我都会收到错误404.我确定我错过了一些东西,但我对Joomla几乎没有任何经验。我会在我的helper.php和我的mod_xxx_xxx.php
中加入代码答案 0 :(得分:2)
模块无法分页。它没有自己的URL。只有组件才有。如果您检查模块创建的链接,您会注意到它们无效。你可以尝试做Ajax魔术,但是你需要一个提供数据的组件。
在Joomla中,只有组件可以直接对传入的URL做出反应。