In Joomla content management system you can use a custom pagination class in extensions. This blog post covers how you can achieve this and successfully add the pagination class in Joomla module. Follow the steps given below.
Step 1: Get Total No. of items in Your database
ex: select count(*) from #__some_table where ….
Step 2: Import Joomla Pagination and Create Pagination Object
jimport('joomla.html.pagination'); $pagination = new JPagination($total, $limitstart, $limit);
where
$total = total number of items that you count in step 1
$limit = total number of items you want to display on a page $limitstart = index of the first item in the page. For example if you have 20 items per page, 0 is start index for 1 page, 20 is start index for second and so on.
Step 3: Show Pagination on Your Page
echo $pagination->getPagesLinks(); echo $pagination->getPagesCounter();
You can get all the information on pagination class in Joomla module in the following link:
Official Joomla Documentation Site – https://docs.joomla.org/J1.5:Using_JPagination_in_your_component