如何使用Joomla分页在前端显示此查询的结果?
<?php
$database =& JFactory::getDBO();
$sql = 'SELECT * FROM #__no_entreprise';
$database->setQuery( $sql );
$rows = $database->loadObjectList();
?
答案 0 :(得分:2)
请参阅Joomla文档 - Using JPagination in your component。简而言之,就像这样:
$pageNav = new JPagination( $database->loadResult(), $lim0, $lim );
echo $pageNav->getListFooter();