PHP Класс Elgg\Views\TableColumn\ColumnFactory

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_columns provides 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 hook.
Показать файл Открыть проект

Открытые методы

Метод Описание
__call ( string $name, array $arguments ) : Elgg\Views\TableColumn Provide additional methods via hook and specified language keys.
fromMethod ( string $name, string $heading = null, array $args = [] ) : CallableColumn Make a column by calling a method on the item
fromProperty ( string $name, string $heading = null ) : CallableColumn Make a column by reading a property of the item
fromView ( string $name, string $heading = null, array $vars = [] ) : ViewColumn Make a column from one of the page/components/column/* views.

Описание методов

__call() публичный Метод

First, the hook table_columns:call is called. Details in docs/guides/hooks-list.rst. Then it checks existence of 3 language keys in order to defer processing to a local method: - "table_columns:fromView:$name" -> uses $this->fromView($name, ...). - "table_columns:fromProperty:$name" -> uses $this->fromProperty($name, ...). - "table_columns:fromMethod:$name" -> uses $this->fromMethod($name, ...). See the from*() methods for details.
public __call ( string $name, array $arguments ) : Elgg\Views\TableColumn
$name string Method name
$arguments array Arguments
Результат Elgg\Views\TableColumn

fromMethod() публичный Метод

Make a column by calling a method on the item
public fromMethod ( string $name, string $heading = null, array $args = [] ) : CallableColumn
$name string Method name. e.g. "getSubtype", "getDisplayName"
$heading string Heading
$args array Method arguments
Результат CallableColumn

fromProperty() публичный Метод

Make a column by reading a property of the item
public fromProperty ( string $name, string $heading = null ) : CallableColumn
$name string Property name. e.g. "description", "email", "type"
$heading string Heading
Результат CallableColumn

fromView() публичный Метод

Make a column from one of the page/components/column/* views.
public fromView ( string $name, string $heading = null, array $vars = [] ) : ViewColumn
$name string Column name (view will be "page/components/column/$name")
$heading string Optional heading
$vars array View vars (item, item_vars, and type will be merged in)
Результат ViewColumn