Structures_DataGrid_Renderer_HTMLTable
[ class tree: Structures_DataGrid_Renderer_HTMLTable ] [ index: Structures_DataGrid_Renderer_HTMLTable ] [ all elements ]

Class: Structures_DataGrid_Renderer_HTMLTable

Source Location: /Structures_DataGrid_Renderer_HTMLTable-0.1.6/Structures/DataGrid/Renderer/HTMLTable.php

Class Overview

Structures_DataGrid_Renderer
   |
   --Structures_DataGrid_Renderer_HTMLTable

HTML Table Rendering Driver


Author(s):

Version:

  • $Revision: 250761 $

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 97]
HTML Table Rendering Driver

Driver for rendering the DataGrid as an HTMLTable

SUPPORTED OPTIONS:

  • evenRowAttributes: (array) An associative array containing each attribute of the even rows.
  • oddRowAttributes: (array) An associative array containing each attribute of the odd rows.
  • emptyRowAttributes: (array) An associative array containing the attributes for empty rows.
  • selfPath: (string) The complete path for sorting and paging links. (default: $_SERVER['PHP_SELF'])
  • sortIconASC: (string) The icon to define that sorting is currently ascending. Can be text or HTML to define an image.
  • sortIconDESC: (string) The icon to define that sorting is currently descending. Can be text or HTML to define an image.
  • classASC: (string) A CSS class name for TH elements to define that sorting is currently ascending.
  • classDESC: (string) A CSS class name for TH elements to define that sorting is currently descending.
  • headerAttributes: (array) Attributes for the header row. This is an array of the form: array(attribute => value, ...)
  • convertEntities: (bool) Whether or not to convert html entities. This calls htmlspecialchars().
  • sortingResetsPaging: (bool) Whether sorting HTTP queries reset paging.
SUPPORTED OPERATION MODES:

  • Container Support: yes
  • Output Buffering: yes
  • Direct Rendering: no
  • Streaming: no
  • Object Preserving: no



[ Top ]


Class Variables

$_table =

[line 104]

Rendering container
  • Var: object
  • Access: protected

Type:   object HTML_Table


[ Top ]



Method Detail

Structures_DataGrid_Renderer_HTMLTable (Constructor)   [line 131]

Structures_DataGrid_Renderer_HTMLTable Structures_DataGrid_Renderer_HTMLTable( )

Constructor

Build default values

  • Access: public

[ Top ]

allowEmptyRows   [line 280]

void allowEmptyRows( bool $value, [array $attributes = array()])

In order for the DataGrid to render "Empty Rows" to allow for uniformity

across pages with varying results, set this option to true. An example of this would be when you have 11 results and have the DataGrid show 10 records per page. The last page will only show one row in the table, unless this option is turned on in which it will render 10 rows, 9 of which will be empty.

  • Access: public

Parameters:

bool   $value   —  A boolean value to determine whether or not to display the empty rows.
array   $attributes   —  The empty row attributes defined in an array.

[ Top ]

buildEmptyRow   [line 482]

void buildEmptyRow( int $index)

Build an empty row

This method will only be called if the "fillWithEmptyRows" option is enabled.

  • Abstract:

Parameters:

int   $index   —  Row index (zero-based)

[ Top ]

buildHeader   [line 364]

void buildHeader( &$columns, array $columns)

Handles building the header of the DataGrid

Parameters:

array   $columns   —  Columns' fields names and labels
   &$columns   — 

[ Top ]

buildRow   [line 447]

void buildRow( int $index, array $data)

Build a body row
  • Access: protected

Parameters:

int   $index   —  Row index (zero-based)
array   $data   —  Record data. Structure: array(0 => <value0>, 1 => <value1>, ...)

[ Top ]

defaultCellFormatter   [line 498]

string defaultCellFormatter( string $value)

Default formatter for all cells
  • Return: Formatted cell value
  • Access: protected

Parameters:

string   $value   —  Cell value

[ Top ]

excludeVars   [line 326]

void excludeVars( array $vars)

Exclude GET variables from the generated links

This method excludes the provided variables from the paging and sorting links. This is helpful when using variables that determine what page to show such as an 'action' variable, etc.

  • Deprecated: Use the "excludeVars" option instead
  • Access: public

Parameters:

array   $vars   —  An array of variables to remove

[ Top ]

finalize   [line 511]

void finalize( )

Finish building the datagrid.
  • Access: protected

[ Top ]

flatten   [line 532]

mixed flatten( )

Retrieve output from the container object
  • Return: Output
  • Access: protected

[ Top ]

getContainer   [line 175]

object HTML_Table &getContainer( )

Return the currently used HTML_Table object
  • Return: (reference to) or PEAR_Error
  • Access: public

[ Top ]

getPaging   [line 556]

string getPaging( [array $options = array()])

Handles the building of the page list for the DataGrid in HTML.

This method uses the HTML::Pager class

Useful options (See Pager's documentation for more): mode: The mode of pager to use separator: The string to use to separate each page link prevImg: The string for the previous page link nextImg: The string for the forward page link delta: The number of pages to display before and after the current page

  • Return: The HTML for the page links
  • See: HTML::Pager
  • Deprecated: Use Structures_DataGrid_Renderer_Pager instead
  • Access: public

Parameters:

array   $options   —  Array of HTML::Pager options

[ Top ]

getTable   [line 351]

object HTML_Table &getTable( )

Gets the HTML_Table object for the DataGrid
  • Return: The HTML Table object for the DataGrid
  • Deprecated: Use getContainer() instead.
  • Access: public

[ Top ]

init   [line 186]

void init( )

Instantiate the HTML_Table container if needed, and set it up
  • Access: protected

[ Top ]

setAutoFill   [line 258]

void setAutoFill( string $value)

Define the table's autofill value. This value appears only in an empty table cell.
  • Access: public

Parameters:

string   $value   —  The value to use for empty cells.

[ Top ]

setContainer   [line 163]

mixed setContainer( &$table)

Attach an already instantiated HTML_Table object
  • Var: object
  • Return: True or PEAR_Error
  • Access: public

Parameters:

   &$table   — 

[ Top ]

setExtraVars   [line 309]

void setExtraVars( array $vars)

Add custom GET variables to the generated links

This method adds the provided variables to the paging and sorting links. The variable values are automatically url encoded.

  • Deprecated: Use the "extraVars" option instead
  • Access: public

Parameters:

array   $vars   —  Array of the form (key => value, ...)

[ Top ]

setTableAttribute   [line 206]

void setTableAttribute( string $attr, string $value)

Set a table attribute
  • Deprecated: Use the HTML_Table constructor directly instead
  • Access: public

Parameters:

string   $attr   —  The name of the attribute.
string   $value   —  The value of the attribute.

[ Top ]

setTableEvenRowAttributes   [line 246]

void setTableEvenRowAttributes( array $attribs)

Define the table's even row attributes
  • See: HTML_Table::setCellAttributes
  • Access: public

Parameters:

array   $attribs   —  The associative array of attributes for the even table row.

[ Top ]

setTableHeaderAttributes   [line 220]

void setTableHeaderAttributes( array $attribs)

Define the table's header row attrbiutes
  • Access: public

Parameters:

array   $attribs   —  The attributes for the table header row.

[ Top ]

setTableOddRowAttributes   [line 233]

void setTableOddRowAttributes( array $attribs)

Define the table's odd row attributes
  • See: HTML_Table::setCellAttributes
  • Access: public

Parameters:

array   $attribs   —  The associative array of attributes for the odd table row.

[ Top ]

toHTML   [line 339]

string toHTML( )

Generates the HTML for the DataGrid
  • Return: The HTML of the DataGrid
  • See: Structures_DataGrid_Renderer::getOutput
  • Deprecated: Use getOutput() instead.
  • Access: public

[ Top ]

useHeader   [line 293]

void useHeader( bool $bool)

Determines whether or not to use the Header
  • Deprecated: Use the "buildHeader" option instead
  • Access: public

Parameters:

bool   $bool   —  value to determine to use the header or not.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:40:02 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.