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
| Property | Type | Description |
|---|---|---|
$template | \GV\Template | The template. |
$view | \GV\View | The view. |
$entry | \GV\Entry | The entry. If single-entry view. |
$entries | \GV\Entry_Collection | The entries. If directory view. |
$fields | \GV\Field_Collection | The fields. |
$field | \GV\Field | The field. When rendering a single field. |
$source | \GV\Source | The data source for a field. |
$display_value | mixed | The display value for a field. |
$value | mixed | The raw value for a field. |
$request | \GV\Request | The request. |
Methods
| Method | Description |
|---|---|
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
| Name | Type | Default | Description |
|---|---|---|---|
$template | \GV\Template | array | The template or array with values expected in a template | |
$data | array | [] | Additional data not tied to the template object. |
Returns
- \GV\Template_Context — The context holder.
Source: future/includes/class-gv-context-template.php:73