BrowserStart a new Browser, add columns, set a join and Render it to create a basic list of records in a table.
You can, of course, get a lot fancier with setting ordering, where clauses totalled columns and so forth.
Located in /classBrowser.php (line 174)
mixed
$BeginRow
(line 194)
mixed
$BeginRowArgs
(line 196)
mixed
$CloseRow
(line 195)
mixed
$Columns
(line 179)
mixed
$Distinct
(line 183)
mixed
$DivClose
(line 204)
mixed
$DivOpen
(line 203)
mixed
$ExtraRows
(line 199)
mixed
$FieldNames
(line 178)
mixed
$ForcedOrder
(line 189)
mixed
$Grouping
(line 190)
mixed
$HiddenColumns
(line 180)
mixed
$Joins
(line 181)
mixed
$Limit
(line 191)
mixed
$match_column
(line 200)
mixed
$match_function
(line 202)
mixed
$match_value
(line 201)
mixed
$Offset
(line 192)
mixed
$Order
(line 185)
mixed
$OrderBrowserKey
(line 188)
mixed
$OrderDirection
(line 187)
mixed
$OrderField
(line 186)
mixed
$Query
(line 193)
mixed
$SubTitle
(line 177)
mixed
$Title
(line 176)
mixed
$TotalFuncs
(line 198)
mixed
$Totals
(line 197)
mixed
$Union
(line 184)
mixed
$Where
(line 182)
Constructor Browser (line 211)
The Browser class constructor
AddColumn (line 257)
Add a column to the Browser.
This constructs a new BrowserColumn, appending it to the array of columns in this Browser.
Note that if the $format parameter starts with '<td>' the format will replace the column format, otherwise it will be used within '<td>...</td>' tags.
The name of a global function which will preprocess the column value
The hook function should be defined as follows: function hookfunction( $column_value, $column_name, $database_row ) { ... return $value; }
AddGrouping (line 446)
AddHidden (line 272)
Add a hidden column - one that is present in the SQL result, but for which there is no column displayed.
This can be useful for including a value in (e.g.) clickable links or title attributes which is not actually displayed as a visible column.
AddOrder (line 471)
Add an ordering to the browser widget.
The ordering can be overridden by GET parameters which will be rendered into the column headers so that a user can click on the column headers to control the actual order.
AddRow (line 644)
Add an extra arbitrary row onto the end of the browser.
AddTotal (line 554)
Mark a column as something to be totalled. You can also specify the name of a function which may modify the value before the actual totalling.
The callback function will be called with each row, with the first argument being the entire record object and the second argument being only the column being totalled. The callback should return a number, to be added to the total.
AndWhere (line 433)
Add an OR ... to the SQL Where clause
DoQuery (line 615)
This method is used to build and execute the database query.
You need not call this method, since Browser::Render() will call it for you if you have not done so at that point.
ForceOrder (line 505)
Force a particular ordering onto the browser widget.
GetTotal (line 567)
Retrieve the total from a totalled column
MatchedRow (line 657)
Replace a row where $column = $value with an extra arbitrary row, returned from calling $function
MoreWhere (line 420)
Add an [operator] ... to the SQL Where clause
You will generally want to call OrWhere or AndWhere rather than this function, but hey: who am I to tell you how to code!
OrWhere (line 442)
Add an OR ... to the SQL Where clause
Render (line 702)
This method is used to render the browser as HTML. If the query has not yet been executed then this will call DoQuery to do so.
The browser (including the title) will be displayed in a div with id="browser" so that you can style '#browser tr.header', '#browser tr.totals' and so forth.
RowFormat (line 594)
Set the format for an output row.
The row format is set as an sprintf format string for the start of the row, and a plain text string for the close of the row. Subsequent arguments are interpreted as names of fields, the values of which will be sprintf'd into the beginrow string for each row.
Some special field names exist beginning with the '#' character which have 'magic' functionality, including '#even' which will insert '0' for even rows and '1' for odd rows, allowing a nice colour alternation if the beginrow format refers to it like: 'class="r%d"' so that even rows will become 'class="r0"' and odd rows will be 'class="r1"'.
At present only '#even' exists, although other magic values may be defined in future.
SetDistinct (line 385)
Set the SQL DISTINCT clause to a specific value.
The whole clause (except the keyword) needs to be supplied
SetDiv (line 336)
Set a div for wrapping the browse.
SetJoins (line 350)
Set the tables and joins for the SQL.
For a single table this should just contain the name of that table, but for multiple tables it should be the full content of the SQL 'FROM ...' clause (excluding the actual 'FROM' keyword).
SetLimit (line 396)
Set the SQL LIMIT clause to a specific value.
Only the limit number should be supplied.
SetOffset (line 407)
Set the SQL OFFSET clause to a specific value.
Only the offset number
SetOrdering (line 532)
Set up the ordering for the browser. Generally you should call this with the first parameter set as a field to order by default. Call with the second parameter set to 'D' or 'DESCEND' if you want to reverse the default order.
SetSubTitle (line 326)
Set a Sub Title for the browse.
SetTitle (line 286)
Set the Title for the browse.
This can also be set in the constructor but if you create a template Browser and then clone it in a loop you may want to assign a different Title for each instance.
SetTranslatable (line 308)
Set the named columns to be translatable
SetUnion (line 363)
Set a Union SQL statement.
In rare cases this might be useful. It's currently a fairly simple hack which requires you to put an entire valid (& matching) UNION subclause (although without the UNION keyword).
SetWhere (line 374)
Set the SQL Where clause to a specific value.
The WHERE keyword should not be included.
Title (line 297)
Accessor for the Title for the browse, which could set the title also.
ValueReplacement (line 673)
Return values from the current row for replacing into a template.
This is used to return values from the current row, so they can be inserted into a row template. It is used as a callback function for preg_replace_callback.
Documentation generated on Fri, 13 Jan 2012 23:40:13 +1300 by phpDocumentor 1.4.3