Skip to main content

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

PropertyTypeDescription
$slugstringThe template slug to be loaded (like "table", "list")

Methods

MethodDescription
__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

NameTypeDefaultDescription
$viewView
$entriesEntry_Collection
$requestRequest

Since: 2.0.4

Source: future/includes/class-gv-template-view-table.php:32

public static function add_columns_sort_links( $column_label, $context=null )

Add sorting links to HTML columns that support sorting

Parameters

NameTypeDefaultDescription
$column_labelstringLabel for the table column
$context\GV\Template_Contextnull

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

NameTypeDefaultDescription
$urlstringSingle-sort URL
$sort_argsarraySingle sorting for rules, in [ field_id, dir ] format
$field_idstring | intID 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

NameTypeDefaultDescription
$entryEntryThe entry to be rendered.
$attributesarrayThe 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

NameTypeDefaultDescription
$fieldFieldThe field to be output.
$entryEntryThe 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

NameTypeDefaultDescription
$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

NameTypeDefaultDescription
$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

NameTypeDefaultDescription
$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

NameTypeDefaultDescription
$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

NameTypeDefaultDescription
$classstringThe class.
$entryEntryThe entry.
$context

Returns

  • string — The classes.

Source: future/includes/class-gv-template-view-table.php:562