Displays a table of rows.
Settings :
- displayNumRows : displays number of rows in a table (default : false)
- minRowsDisplayLinks : minimum rows before displaying number of rows
on top of the table. (default = 10)
Methods
Constructor, initialises an instance of Formaid_Table
__construct(string $table_name, string $file_name, string $order_by, string $database) : void
Parameters
$table_name
stringTable name
$file_name
stringFile name of page containing the table
$order_by
stringSQL column name to order by
$database
stringDatabase to use
Displays a HTML table.
display() : void
Returns a HTML string of a table.
getDisplayString() : string
Returns string with links to create new items.
getNewItemLinksString() : string
Returns
stringlinks to create new items
Returns number of items string.
getNumItemsString() : string
Returns
stringwith number of items
Add the result of an SQL query as values to the table
importSqlValues(object $sql_result) : void
Parameters
$sql_result
objectreturn object of a sql request
Displays a HTML table.
show() : void
Checks if adding a new item is allowed.
allowAdd() : bool
If the Privileges on this table (allow_add) is set,
it is allowed to add a new item.
Returns
booltrue if adding is allowed.
Checks if displaying the table is allowed.
allowShow() : bool
If the Privileges on this table (allow_show) is set,
it is allowed to display the table.
Returns
booltrue if displaying is allowed.
Executes an SQL query retrieving data from a table
that will be displayed in the HTML table.
_getSelectQueryResult() : object
Returns
objectSQL query result
Properties
$settings : array
Array with property objects