Elgg
Version master
|
Factory for table column objects. More...
Public Member Functions | |
fromView ($name, $heading=null, $vars=[]) | |
Make a column from one of the page/components/column/* views. More... | |
fromProperty ($name, $heading=null) | |
Make a column by reading a property of the item. More... | |
fromMethod ($name, $heading=null, $args=[]) | |
Make a column by calling a method on the item. More... | |
__call ($name, $arguments) | |
Provide additional methods via events and specified language keys. More... | |
Factory for table column objects.
elgg_list_entities()
can output tables by specifying `$options['list_type'] = 'table'and by providing an array of TableColumn objects to
$options['columns']. This service, available as
elgg()->table_columnsprovides methods to create column objects based around existing views like
page/components/column/*`, properties, or methods.
Numerous pre-existing methods are provided via __call()
magic. See this method to find out how to add your own methods, override the existing ones, or completely replace a method via event.
Definition at line 48 of file ColumnFactory.php.
Elgg\Views\TableColumn\ColumnFactory::__call | ( | $name, | |
$arguments | |||
) |
Provide additional methods via events and specified language keys.
First, the event table_columns:call
is called. Details in docs/guides/events-list.rst
.
Then it checks existence of 3 language keys in order to defer processing to a local method:
See the from*()
methods for details.
string | $name | Method name |
array | $arguments | Arguments |
Definition at line 143 of file ColumnFactory.php.
Elgg\Views\TableColumn\ColumnFactory::fromMethod | ( | $name, | |
$heading = null , |
|||
$args = [] |
|||
) |
Make a column by calling a method on the item.
string | $name | Method name. e.g. "getSubtype", "getDisplayName" |
string | $heading | Heading |
array | $args | Method arguments |
Definition at line 108 of file ColumnFactory.php.
Elgg\Views\TableColumn\ColumnFactory::fromProperty | ( | $name, | |
$heading = null |
|||
) |
Make a column by reading a property of the item.
string | $name | Property name. e.g. "description", "email", "type" |
string | $heading | Heading |
Definition at line 82 of file ColumnFactory.php.
Elgg\Views\TableColumn\ColumnFactory::fromView | ( | $name, | |
$heading = null , |
|||
$vars = [] |
|||
) |
Make a column from one of the page/components/column/* views.
string | $name | Column name (view will be "page/components/column/$name") |
string | $heading | Optional heading |
array | $vars | View vars (item, item_vars, and type will be merged in) |
Definition at line 59 of file ColumnFactory.php.