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
string
Table name
$file_name
string
File name of page containing the table
$order_by
string
SQL column name to order by
$database
string
Database 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
string
links to create new items
Returns number of items string.
getNumItemsString() : string
Returns
string
with number of items
Add the result of an SQL query as values to the table
importSqlValues(object $sql_result) : void
Parameters
$sql_result
object
return 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
bool
true 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
bool
true if displaying is allowed.
Executes an SQL query retrieving data from a table
that will be displayed in the HTML table.
_getSelectQueryResult() : object
Returns
object
SQL query result
Properties
$settings : array
Array with property objects