Elgg  Version 2.3
CallableColumn.php
Go to the documentation of this file.
1 <?php
3 
5 
9 class CallableColumn implements TableColumn {
10 
14  private $heading;
15 
19  private $renderer;
20 
27  public function __construct(callable $renderer, $heading) {
28  $this->renderer = $renderer;
29  $this->heading = $heading;
30  }
31 
35  public function renderHeading() {
36  return $this->heading;
37  }
38 
42  public function renderCell($item, $type, $item_vars) {
43  return call_user_func($this->renderer, $item, $type, $item_vars);
44  }
45 }
if(!$items) $item
Definition: delete.php:17
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...
__construct(callable $renderer, $heading)
Constructor.
Table column rendered by a function.
A renderer for a column of table cells and a header.
Definition: TableColumn.php:7
renderHeading()
{Get the rendered heading cell as HTML.Cell will be auto-wrapped with a TH element if the returned st...
http free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:5
if(!$display_name) $type
Definition: delete.php:27