AnewtGridCellRenderer class

A cell renderer for the AnewtGridRenderer.

Class Overview

A cell renderer for the AnewtGridRenderer.

This grid renderer just renders the data as a cell (without any special effects).

Public Methods

__construct($id)

Constructs a new AnewtGridCellRenderer.

Parameters

$id

The id for this cell renderer. It will be used to match against the row data in the grid.

render_cell($data)

Renders the cell.

Parameters

$data

Data to pack into the cell

Return value

Rendered cell

Protected Methods

create_td($value) [protected]

Create a XHTML cell based on the provided value.

This method handles a variety of data types easibly convertible to strings, and takes the highlight property of the AnewtGridColumn into account when rendering into a HTML <td> table cell. You can use this method to render the final result in custom cell renderers (after doing done your custom formatting based on the row data).

Parameters

$value

Value to render

Return value

XHTML snippet for a table cell

fetch_value_from_data($data) [protected]

Fetch default value from the row data, based on the cell renderer id.

This method is used internally to fetch the cell data from the row data object. Both associative arrays and AnewtContainer objects are handled. Which value is retrieved depends on the id of the cell renderer; if you did not instantiate an AnewtGridCellRenderer yourself, this is will be the same as the column id.

Custom AnewtGridCellRenderer subclasses may use this method as a convenience method to get data from the row object prior to further processing or formatting.

Parameters

$data

Row data

Return value

Value extracted from row data, based on the id

Public Attributes

$id

The id of this cell renderer.

Private Attributes

$_column [private]

Reference to the parent column.

Inheritance

Base Classes

Inherited members