Overview

Namespaces

  • None
  • PHP

Classes

  • Breadcrumb
  • Breadcrumbs
  • CacheFile
  • Comment
  • CommentArray
  • CommentFilter
  • CommentForm
  • CommentList
  • Config
  • Database
  • DatabaseQuery
  • DatabaseQuerySelect
  • DatabaseQuerySelectFulltext
  • DatabaseStopwords
  • Debug
  • Field
  • Fieldgroup
  • Fieldgroups
  • FieldgroupsArray
  • Fields
  • FieldsArray
  • Fieldtype
  • FieldtypeMulti
  • Fieldtypes
  • FileLog
  • FilenameArray
  • Fuel
  • HookEvent
  • ImageSizer
  • Inputfield
  • InputfieldsArray
  • InputfieldWrapper
  • Language
  • LanguageParser
  • Languages
  • LanguagesPageFieldValue
  • LanguageSupportInstall
  • LanguageTranslator
  • Markdown_Parser
  • MarkdownExtra_Parser
  • ModuleJS
  • ModulePlaceholder
  • Modules
  • Notice
  • NoticeError
  • NoticeMessage
  • Notices
  • NullPage
  • Page
  • PageArray
  • Pagefile
  • Pagefiles
  • PagefilesManager
  • PageFinder
  • Pageimage
  • Pageimages
  • PagerNav
  • PagerNavItem
  • Pages
  • PagesAccess
  • PagesSortfields
  • PagesType
  • Paths
  • Permission
  • Permissions
  • Process
  • ProcessController
  • ProcessWire
  • Role
  • Roles
  • Sanitizer
  • Selector
  • SelectorBitwiseAnd
  • SelectorContains
  • SelectorContainsLike
  • SelectorContainsWords
  • SelectorEnds
  • SelectorEqual
  • SelectorGreaterThan
  • SelectorGreaterThanEqual
  • SelectorLessThan
  • SelectorLessThanEqual
  • SelectorNotEqual
  • Selectors
  • SelectorStarts
  • Session
  • SessionCSRF
  • SmartyPants_Parser
  • SmartyPantsTypographer_Parser
  • SystemUpdate1
  • Template
  • TemplateFile
  • Templates
  • TemplatesArray
  • Textformatter
  • Textile
  • User
  • Users
  • Wire
  • WireArray
  • WireData
  • WireInput
  • WireInputData
  • WireSaveableItems
  • WireSaveableItemsLookup
  • WireUpload

Interfaces

  • CommentFormInterface
  • CommentListInterface
  • ConfigurableModule
  • FieldtypeLanguageInterface
  • FieldtypePageTitleCompatible
  • HasLookupItems
  • HasRoles
  • InputfieldHasArrayValue
  • Module
  • Saveable
  • TrackChanges

Exceptions

  • ProcessController404Exception
  • ProcessControllerPermissionException
  • Wire404Exception
  • WireDatabaseException
  • WireException
  • WirePermissionException

Functions

  • __
  • _n
  • _x
  • fuel
  • identify_modifier_markdown
  • Markdown
  • mdwp_add_p
  • mdwp_hide_tags
  • mdwp_show_tags
  • mdwp_strip_p
  • ProcessWireClassLoader
  • ProcessWireHostSiteConfig
  • ProcessWireShutdown
  • removeNewlines
  • SmartDashes
  • SmartEllipsis
  • SmartQuotes
  • smarty_modifier_markdown
  • smarty_modifier_smartypants
  • SmartyPants
  • tabIndent
  • unregisterGLOBALS
  • wire
  • wireDecodeJSON
  • wireEncodeJSON
  • wireMkdir
  • Overview
  • Namespace
  • Class
  • Tree
  • Download

Class TemplateFile

ProcessWire TemplateFile

A template file that will be loaded and executed as PHP, and it's output returned

ProcessWire 2.x Copyright (C) 2010 by Ryan Cramer Licensed under GNU/GPL v2, see LICENSE.TXT

http://www.processwire.com http://www.ryancramer.com

Wire implements TrackChanges
Extended by WireData implements IteratorAggregate
Extended by TemplateFile
Located at core/TemplateFile.php
Methods summary
public
# __construct( string $filename = '' )

Construct the template file

Construct the template file

Parameters

$filename
string
Full path and filename to the PHP template file
public
# setFilename( string $filename )

Sets the template file name, replacing whatever was set in the constructor

Sets the template file name, replacing whatever was set in the constructor

Parameters

$filename
string
Full path and filename to the PHP template file
public
# setGlobal( string $name, mixed $value, boolean $overwrite = true )

Sets a variable to be globally accessable to all other TemplateFile instances

Sets a variable to be globally accessable to all other TemplateFile instances

Note, to set a variable for just this instance, use the set() as inherted from WireData.

Parameters

$name
string
$value
mixed
$overwrite
boolean
Should the value be overwritten if it already exists? (default true)
public string
# ___render( )

Render the template -- execute it and return it's output

Render the template -- execute it and return it's output

Returns

string
The output of the Template File
public array
# getArray( )

Get an array of all variables accessible (locally scoped) to the PHP template file

Get an array of all variables accessible (locally scoped) to the PHP template file

Returns

array
public mixed
# get( string|object $property )

Get a set property from the template file, typically to check if a template has access to a given variable

Get a set property from the template file, typically to check if a template has access to a given variable

Parameters

$property
string|object
$key

Returns

mixed
Returns the value of the requested property, or NULL if it doesn't exist
public
# __toString( )

The string value of a TemplateFile is it's PHP template filename OR it's class name if no filename is set

The string value of a TemplateFile is it's PHP template filename OR it's class name if no filename is set

Methods inherited from WireData
__get(), __isset(), __set(), __unset(), getIterator(), has(), isEqual(), remove(), set(), setArray()
Methods inherited from Wire
_(), ___changed(), __call(), _n(), _x(), addHook(), addHookAfter(), addHookBefore(), addHookProperty(), className(), error(), fuel(), getAllFuel(), getChanges(), getFuel(), getHooks(), isChanged(), isHooked(), message(), removeHook(), resetTrackChanges(), runHooks(), setFuel(), setTrackChanges(), trackChange(), trackChanges(), untrackChange(), useFuel()
Properties summary
protected $filename
#

The full path and filename to the PHP template file

The full path and filename to the PHP template file

protected $savedDir
#

The saved directory location before render() was called

The saved directory location before render() was called

protected static array $globals array()
#

Variables that will be applied globally to this and all other TemplateFile instances

Variables that will be applied globally to this and all other TemplateFile instances

Properties inherited from WireData
$data
Properties inherited from Wire
$changes, $defaultHookOptions, $fuel, $hookMethodCache, $localHooks, $staticHooks, $trackChanges, $useFuel
ProcessWire API documentation generated by ApiGen 2.6.0