GV\View_Table_Template
The View Table Template class .
Renders a \GV\View and a \GV\Entry_Collection via a \GV\View_Renderer.
Source: future/includes/class-gv-template-view-table.php:16
Details
- Kind:
class - Namespace:
GV - Extends:
View_Template
Properties
| Property | Type | Description |
|---|---|---|
$slug | string | The template slug to be loaded (like "table", "list") |
Methods
| Method | Description |
|---|---|
__construct() | Constructor. Add filters to modify output. |
add_columns_sort_links() | Add sorting links to HTML columns that support sorting |
_get_multisort_url() | Get the multi-sort URL used in the sorting links |
the_columns() | Output the table column names. |
the_entry() | Output the entry row. |
the_field() | Output a field cell. |
body_before() | gravityview_table_body_before and gravityview/template/table/body/before actions. |
body_after() | gravityview_table_body_after and gravityview/template/table/body/after actions. |
tr_before() | gravityview_table_tr_before and gravityview/template/table/tr/after actions. |
tr_after() | gravityview_table_tr_after and gravityview/template/table/tr/after actions. |
entry_class() | gravityview_entry_class and gravityview/template/table/entry/class filters. |
Method Reference
__construct()
public function __construct( View $view, Entry_Collection $entries, Request $request )
Constructor. Add filters to modify output.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$view | View | ||
$entries | Entry_Collection | ||
$request | Request |
Since: 2.0.4
Source: future/includes/class-gv-template-view-table.php:32
add_columns_sort_links()
public static function add_columns_sort_links( $column_label, $context=null )
Add sorting links to HTML columns that support sorting
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$column_label | string | Label for the table column | |
$context | \GV\Template_Context | null |
Returns
string
Since:
Source: future/includes/class-gv-template-view-table.php:52
_get_multisort_url()
public static function _get_multisort_url( $url, $sort_args, $field_id )
Get the multi-sort URL used in the sorting links
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$url | string | Single-sort URL | |
$sort_args | array | Single sorting for rules, in [ field_id, dir ] format | |
$field_id | string | int | ID of the current field being displayed |
Returns
string— Multisort URL, if there are multiple sorts. Otherwise, existing $url
See Also
add_columns_sort_links
Since: 2.3
Source: future/includes/class-gv-template-view-table.php:154
the_columns()
public function the_columns()
Output the table column names.
Returns
void
Source: future/includes/class-gv-template-view-table.php:194
the_entry()
public function the_entry( Entry $entry, $attributes )
Output the entry row.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry | Entry | The entry to be rendered. | |
$attributes | array | The attributes for the <tr> tag |
Returns
void
Source: future/includes/class-gv-template-view-table.php:252
the_field()
public function the_field( Field $field, Entry $entry )
Output a field cell.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | Field | The field to be output. | |
$entry | Entry | The Entry this field is for. |
Returns
void
Source: future/includes/class-gv-template-view-table.php:388
body_before()
public static function body_before( $context )
gravityview_table_body_before and gravityview/template/table/body/before actions.
Output inside the tbody of the table.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$context | \GV\Template_Context The 2.0 context. |
Returns
void
Source: future/includes/class-gv-template-view-table.php:446
body_after()
public static function body_after( $context )
gravityview_table_body_after and gravityview/template/table/body/after actions.
Output inside the tbody of the table.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$context | \GV\Template_Context The 2.0 context. |
Returns
void
Source: future/includes/class-gv-template-view-table.php:475
tr_before()
public static function tr_before( $context )
gravityview_table_tr_before and gravityview/template/table/tr/after actions.
Output inside the tr of the table.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$context | \GV\Template_Context The 2.0 context. |
Returns
void
Source: future/includes/class-gv-template-view-table.php:504
tr_after()
public static function tr_after( $context )
gravityview_table_tr_after and gravityview/template/table/tr/after actions.
Output inside the tr of the table.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$context | \GV\Template_Context The 2.0 context. |
Returns
void
Source: future/includes/class-gv-template-view-table.php:532
entry_class()
public static function entry_class( $class, $entry, $context )
gravityview_entry_class and gravityview/template/table/entry/class filters.
Modify of the class of a row.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$class | string | The class. | |
$entry | Entry | The entry. | |
$context |
Returns
string— The classes.
Source: future/includes/class-gv-template-view-table.php:562