Pagination Class
This classes uses array or a SQL query to produce a pagination list of links. It also produce the SQL for retrieving the next set of values from the database.
Code: Set paging = New Pagination paging.base_url = "library/pagination" paging.order_by = "order by field" paging.sql = "sample sql here" page_links = paging.create_links table_sql = paging.create_sql table_count = paging.getCount Set paging = Nothing write = write & page_links Output:
Preference | Default | Options | Description |
---|---|---|---|
base_url | Required | Text | This is the URL to build the pagination links |
conn | Required | Text | The connection number |
sql | Required | Text (Valid SQL Statement) | This is the SQL Statement that creates the count and the pagination query. |
order_by | Required | Text | This is the order by field |
order_type | optional | Text | default is ASC |
per_page | optional | Integer | Default: 10 |
segment | optional | Integer | Default: 3 |
first_link | optional | Text | Default: First » |
last_link | optional | Text | Default: Last » |
next_link | optional | Text | Default: > |
prev_link | optional | Text | Default: < |
separator | optional | Text | Default: space |
num_links | optional | Text | This is the max number of links around the current link |
only_nextprev | optional | TRUE or FALSE (boolean) | This shows the links or just the Next and Prev Links |