PagingtableHelper
extends Helper
in package
Used to create links to go backward/forwards and search a database tables. HTML table with data representing a database table might have millions of rows so want to limit what the user actually gets at one time and just allow the user to "page" through in increments of 10, 20, 50, 100, 200 rows at a time.
Tags
Table of Contents
- $show_choices : array<string|int, mixed>
- The choices for how many rows out of the database table to display
- __construct() : mixed
- The constructor at this point does nothing
- desktopTableControls() : mixed
- Draws the heading before the user table as well as the controls for what user to see (desktop, laptop, tablet case).
- drawTableTitle() : mixed
- Draw title of heading on table as well as the add row form toggle
- mobileTableControls() : mixed
- Draws the heading before a paging table as well as the controls for what rows to see (mobile phone case).
- render() : mixed
- Used to render the links to go backwards and forwards through a database table. We have two separate functions for the mobile and desktop drawers.
Properties
$show_choices
The choices for how many rows out of the database table to display
public
array<string|int, mixed>
$show_choices
= [10 => 10, 20 => 20, 50 => 50, 100 => 100, 200 => 200]
Methods
__construct()
The constructor at this point does nothing
public
__construct() : mixed
Return values
mixed —desktopTableControls()
Draws the heading before the user table as well as the controls for what user to see (desktop, laptop, tablet case).
public
desktopTableControls(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
-
needed for dropdown values for number of groups to display
Return values
mixed —drawTableTitle()
Draw title of heading on table as well as the add row form toggle
public
drawTableTitle(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
-
from controller/component to figure out localized table name ($data['TABLE_TITLE']) as well as the toggle state of the add row form $data['DISABLE_ADD_TOGGLE']
Return values
mixed —mobileTableControls()
Draws the heading before a paging table as well as the controls for what rows to see (mobile phone case).
public
mobileTableControls(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
-
needed for dropdown values for number of groups to display
Return values
mixed —render()
Used to render the links to go backwards and forwards through a database table. We have two separate functions for the mobile and desktop drawers.
public
render(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
-
fields of this contain values from the controller for the CSRF_TOKEN; NUM_TOTAL of rows; NUM_SHOW, the number to show; etc.