GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Data Fields | Static Public Attributes | Protected Attributes
View_Template Class Reference

If this file is called directly, abort. More...

Inheritance diagram for View_Template:
Template View_Legacy_Template View_List_Template View_Table_Template

Public Member Functions

 __construct (View $view, Entry_Collection $entries, Request $request)
 Initializer. More...
 
 __destruct ()
 
 add_id_specific_templates ( $templates, $slug, $name)
 Enable granular template overrides based on current post, view, form, etc. More...
 
 render ()
 Output some HTML. More...
 
- Public Member Functions inherited from Template
 __construct ()
 General template initialization. More...
 
 __destruct ()
 Disallow any cleanup for fear of loss of global data. More...
 
 pop_template_data ( $var_name='data')
 Restore the template data from the stack. More...
 
 push_template_data ( $data, $var_name='data')
 Push the current template data down the stack and set. More...
 

Data Fields

 $entries
 
 $request
 
 $view
 
- Data Fields inherited from Template
 $located_template = ''
 

Static Public Attributes

static $slug
 

Protected Attributes

 $filter_prefix = 'gravityview/template/views'
 
 $plugin_template_directory = 'templates/views/'
 
 $theme_template_directory = 'gravityview/views/'
 

Additional Inherited Members

- Static Public Member Functions inherited from Template
static split_slug ( $slug, $name=null)
 Get a directory part and a full slug+name (file) components. More...
 

Detailed Description

If this file is called directly, abort.

Load up the Gamajo Template Loader.

See also
https://github.com/GaryJones/Gamajo-Template-Loader The View Template class .

Renders a and a via a .

Definition at line 23 of file class-gv-template-view.php.

Constructor & Destructor Documentation

◆ __construct()

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

Initializer.

Parameters
\GV\View$viewThe View connected to this template.
\GV\Entry_Collection$entriesA collection of entries for this view.
\GV\Request$requestThe request context.

Add granular overrides.

Definition at line 69 of file class-gv-template-view.php.

References $entries.

◆ __destruct()

__destruct ( )

Definition at line 80 of file class-gv-template-view.php.

Member Function Documentation

◆ add_id_specific_templates()

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
See also
Gamajo_Template_Loader::get_template_file_names() Where the filter is
Parameters
array$templatesExisting list of templates.
string$slugName of the template base, example: table, list, datatables, map
string$nameName of the template part, example: body, footer, head, single
Returns
array $templates Modified template array, merged with existing $templates values

Definition at line 102 of file class-gv-template-view.php.

References $name, $post, and $templates.

◆ render()

render ( )

Output some HTML.

Returns
void

Make various pieces of data available to the template under the $gravityview scoped variable.

Runs Filter:
gravityview/template/view/context
Parameters
\GV\Template_Context$contextThe context for this template.
\GV\View_Template$templateThe current template.
Since
2.0
Runs Filter:
gravityview/template/view/render Before rendering.
Parameters
\GV\View_Template$templateThe current template.
Since
2.0

Load the template.

Definition at line 127 of file class-gv-template-view.php.

References gravityview().

Field Documentation

◆ $entries

$entries

Definition at line 50 of file class-gv-template-view.php.

◆ $filter_prefix

$filter_prefix = 'gravityview/template/views'
protected

Definition at line 28 of file class-gv-template-view.php.

◆ $plugin_template_directory

$plugin_template_directory = 'templates/views/'
protected

Definition at line 40 of file class-gv-template-view.php.

◆ $request

$request

Definition at line 55 of file class-gv-template-view.php.

◆ $slug

$slug
static

Definition at line 60 of file class-gv-template-view.php.

◆ $theme_template_directory

$theme_template_directory = 'gravityview/views/'
protected

Definition at line 34 of file class-gv-template-view.php.

◆ $view

$view

Definition at line 45 of file class-gv-template-view.php.


The documentation for this class was generated from the following file: