Elgg  Version master
Public Member Functions | Protected Attributes | List of all members
Elgg\Views\TableColumn\ViewColumn Class Reference

Table column rendered by a view. More...

Inheritance diagram for Elgg\Views\TableColumn\ViewColumn:
Elgg\Views\TableColumn

Public Member Functions

 __construct (protected string $view, string $heading=null, protected array $vars=[])
 Constructor. More...
 
 renderHeading ()
 {Get the rendered heading cell as HTML.Cell will be auto-wrapped with a TH element if the returned string doesn't begin with "<th" or "<td".
Returns
string e.g. "Title" or "<th>Title</th>". You must filter/escape any user content.
} More...
 
 renderCell ($item, $type, $item_vars)
 {Render a value cell as HTML.Cell will be auto-wrapped with a TD element if the returned string doesn't begin with "<th" or "<td".
Parameters
mixed$itemObject/row from which to pull the value
string$typeType of object
array$item_varsParameters from the listing function
Returns
string e.g. "My Great Title" or "<td>My Great Title</td>". You must filter/escape any user content.
} More...
 

Protected Attributes

string $heading
 

Detailed Description

Table column rendered by a view.

Definition at line 10 of file ViewColumn.php.

Constructor & Destructor Documentation

Elgg\Views\TableColumn\ViewColumn::__construct ( protected string  $view,
string  $heading = null,
protected array  $vars = [] 
)

Constructor.

Parameters
string$viewThe view to render the value
string$headingHeading
array$varsVars to merge into the view vars

Definition at line 21 of file ViewColumn.php.

Member Function Documentation

Elgg\Views\TableColumn\ViewColumn::renderCell (   $item,
  $type,
  $item_vars 
)

{Render a value cell as HTML.Cell will be auto-wrapped with a TD element if the returned string doesn't begin with "<th" or "<td".

Parameters
mixed$itemObject/row from which to pull the value
string$typeType of object
array$item_varsParameters from the listing function
Returns
string e.g. "My Great Title" or "<td>My Great Title</td>". You must filter/escape any user content.
}

Implements Elgg\Views\TableColumn.

Definition at line 39 of file ViewColumn.php.

Elgg\Views\TableColumn\ViewColumn::renderHeading ( )

{Get the rendered heading cell as HTML.Cell will be auto-wrapped with a TH element if the returned string doesn't begin with "<th" or "<td".

Returns
string e.g. "Title" or "<th>Title</th>". You must filter/escape any user content.
}

Implements Elgg\Views\TableColumn.

Definition at line 32 of file ViewColumn.php.

Member Data Documentation

string Elgg\Views\TableColumn\ViewColumn::$heading
protected

Definition at line 12 of file ViewColumn.php.


The documentation for this class was generated from the following file: