Skip to main content

GV\View_Template

The View Template class .

Renders a \GV\View and a \GV\Entry_Collection via a \GV\View_Renderer.

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

Details

  • Kind: class
  • Namespace: GV
  • Extends: Template

Properties

PropertyTypeDescription
$filter_prefixstringPrefix for filter names.
$theme_template_directorystringDirectory name where custom templates for this plugin should be found in the theme.
$plugin_template_directorystringDirectory name where the default templates for this plugin are found.
$view\GV\ViewThe view connected to this template.
$entries\GV\Entry_CollectionThe entries that need to be rendered.
$request\GV\RequestThe request context.
$slugstringThe template slug to be loaded (like "table", "list")

Methods

MethodDescription
__construct()Initializer.
add_id_specific_templates()Enable granular template overrides based on current post, view, form, etc.
render()Output some HTML.

Method Reference

__construct()

public function __construct( View $view, Entry_Collection $entries, Request $request )

Initializer.

Parameters

NameTypeDefaultDescription
$view\GV\ViewThe View connected to this template.
$entries\GV\Entry_CollectionA collection of entries for this view.
$request\GV\RequestThe request context.

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

add_id_specific_templates()

public function add_id_specific_templates( $templates, $slug, $name )

Enable granular template overrides based on current post, view, form, etc.

The loading order is:

  • post-[ID of post or page where view is embedded]-view-[View ID]-table-footer.php
  • post-[ID of post or page where view is embedded]-table-footer.php
  • view-[View ID]-table-footer.php
  • form-[Form ID]-table-footer.php
  • table-footer.php

Parameters

NameTypeDefaultDescription
$templatesarrayExisting list of templates.
$slugstringName of the template base, example: table, list, datatables, map
$namestringName of the template part, example: body, footer, head, single

Returns

  • array — $templates Modified template array, merged with existing $templates values

See Also

  • \Gamajo_Template_Loader::get_template_file_names() Where the filter is

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

render()

public function render()

Output some HTML.

Returns

  • void

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