Warning: ini_set(): Session save handler "user" cannot be set by ini_set() in include_once() (line 164 of /home/w3shncom/public_html/sites/default/settings.php).
In Drupal 8 module development, we can easily create a table with pager. The code might be different from the one we use in Drupal 7, but it's still quite simple. I assume you have already learned to create a simple Drupal 8 "Hello World!" module as explained in there. So, let's start to create the table with pager. For example, we have a routing file, mydemo.routing.yml like the following.
It's almost two weeks since I started to learn Django until this article is written. It's true that Django has a very powerfull pagination function. When we use it with QuerySet, the query result won't be fetched until we print the result. Yeah, it really saves the performance, but when we use it together with the raw query, all the query result will be fetched first then the library will perform the pagination on it. To solve the problem, I try to create the custom pagination class for Django.
When developing a module for Drupal 7 you can display the query result into a table and then display it along with the pagination. You can do it relatively easy with functions provided by Drupal. Look at the code below to see how to create a table with pagination in Drupal 7.
Creating paging in traditional way can be troublesome, especially if you have to create it for many pages. This class will help you to solve that problem. By using this class you can create pagination with PHP and MySQL easily with just a few lines of code.