Skip to main content

GV\Template_Context

A template Context class.

This is provided to most template files as a global.

Source: future/includes/class-gv-context-template.php:14

Details

  • Kind: class
  • Namespace: GV
  • Extends: Context

Properties

PropertyTypeDescription
$template\GV\TemplateThe template.
$view\GV\ViewThe view.
$entry\GV\EntryThe entry. If single-entry view.
$entries\GV\Entry_CollectionThe entries. If directory view.
$fields\GV\Field_CollectionThe fields.
$field\GV\FieldThe field. When rendering a single field.
$source\GV\SourceThe data source for a field.
$display_valuemixedThe display value for a field.
$valuemixedThe raw value for a field.
$request\GV\RequestThe request.

Methods

MethodDescription
from_template()Create a context from a Template

Method Reference

from_template()

public static function from_template( $template, $data=[] )

Create a context from a Template

Parameters

NameTypeDefaultDescription
$template\GV\Template | arrayThe template or array with values expected in a template
$dataarray[]Additional data not tied to the template object.

Returns

Source: future/includes/class-gv-context-template.php:73