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 173)
mixed
$BeginRow
(line 193)
mixed
$BeginRowArgs
(line 195)
mixed
$CloseRow
(line 194)
mixed
$Columns
(line 178)
mixed
$Distinct
(line 182)
mixed
$DivClose
(line 203)
mixed
$DivOpen
(line 202)
mixed
$ExtraRows
(line 198)
mixed
$FieldNames
(line 177)
mixed
$ForcedOrder
(line 188)
mixed
$Grouping
(line 189)
mixed
$HiddenColumns
(line 179)
mixed
$Joins
(line 180)
mixed
$Limit
(line 190)
mixed
$match_column
(line 199)
mixed
$match_function
(line 201)
mixed
$match_value
(line 200)
mixed
$Offset
(line 191)
mixed
$Order
(line 184)
mixed
$OrderBrowserKey
(line 187)
mixed
$OrderDirection
(line 186)
mixed
$OrderField
(line 185)
mixed
$Query
(line 192)
mixed
$SubTitle
(line 176)
mixed
$Title
(line 175)
mixed
$TotalFuncs
(line 197)
mixed
$Totals
(line 196)
mixed
$Union
(line 183)
mixed
$Where
(line 181)
Constructor Browser (line 210)
The Browser class constructor
AddColumn (line 256)
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 432)
AddHidden (line 271)
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 457)
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 630)
Add an extra arbitrary row onto the end of the browser.
AddTotal (line 540)
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 419)
Add an OR ... to the SQL Where clause
DoQuery (line 601)
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 491)
Force a particular ordering onto the browser widget.
GetTotal (line 553)
Retrieve the total from a totalled column
MatchedRow (line 643)
Replace a row where $column = $value with an extra arbitrary row, returned from calling $function
MoreWhere (line 406)
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 428)
Add an OR ... to the SQL Where clause
Render (line 688)
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 580)
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 371)
Set the SQL DISTINCT clause to a specific value.
The whole clause (except the keyword) needs to be supplied
SetDiv (line 322)
Set a div for wrapping the browse.
SetJoins (line 336)
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 382)
Set the SQL LIMIT clause to a specific value.
Only the limit number should be supplied.
SetOffset (line 393)
Set the SQL OFFSET clause to a specific value.
Only the offset number
SetOrdering (line 518)
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 312)
Set a Sub Title for the browse.
SetTitle (line 285)
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 294)
Set the named columns to be translatable
SetUnion (line 349)
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 360)
Set the SQL Where clause to a specific value.
The WHERE keyword should not be included.
ValueReplacement (line 659)
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 Tue, 06 Oct 2009 09:31:43 -0700 by phpDocumentor 1.3.2