Class Template (namespace Nette\Templates)


Template.

Object
   |
   --Template

Implements interfaces:

Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Templates/Template.php (line 36)
Public Method Summary
void
add (string $name, mixed $value)
Adds new template parameter.
Template
addTemplate (string $name, string|Template $file)
Adds new template as parameter.
static ICacheStorage
string
getFile ()
Returns the path to the template file.
array
Returns array of all parameters.
void
registerFilter (callback $callback)
Registers callback as template filter.
void
registerHelper (string $name, callback $callback)
Registers callback as template helper.
void
registerHelperLoader (callback $callback)
Registers callback as template helpers loader.
void
render ()
Renders template to output.
static void
setCacheStorage ($storage)
Set cache storage.
void
setFile (string $file)
Sets the path to the template file.
void
setTranslator ([$translator = NULL])
Sets translate adapter.
Template
subTemplate (string $file, [$params = NULL])
Creates subtemplate.
SimpleXMLElement
toXml ()
Converts to SimpleXML. (experimental)
mixed
__call (string $name, array $args)
Call a template helper. Do not call directly.
& mixed
__get (string $name)
Returns a template parameter. Do not call directly.
bool
__isset (string $name)
Determines whether parameter is defined. Do not call directly.
void
__set (string $name, mixed $value)
Sets a template parameter. Do not call directly.
string
__toString (bool 0)
Renders template to string.
void
__unset (string $name)
Removes a template parameter. Do not call directly.
Methods Inherited From Object
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Variable Summary
static int $cacheExpire FALSE

line 57

bool $warnOnUndefined TRUE

line 39


Method Details

line 355

add

public void add (string $name, mixed $value)

Adds new template parameter.

Input
string $name name
mixed $value value
Output
void  

line 372

addTemplate

public Template addTemplate (string $name, string|Template $file)

Adds new template as parameter.

Input
string $name name
string|Template $file file name or Template object
Output
Template  

line 464

getCacheStorage

public static ICacheStorage getCacheStorage ()

Output
ICacheStorage  

line 80

getFile

public string getFile ()

Returns the path to the template file.

Implementation of:

Output
string template file path

line 385

getParams

public array getParams ()

Returns array of all parameters.

Output
array  

line 127

registerFilter

public void registerFilter (callback $callback)

Registers callback as template filter.

Input
callback $callback
Output
void  

line 279

registerHelper

public void registerHelper (string $name, callback $callback)

Registers callback as template helper.

Input
string $name
callback $callback
Output
void  

line 296

registerHelperLoader

public void registerHelperLoader (callback $callback)

Registers callback as template helpers loader.

Input
callback $callback
Output
void  

line 147

render

public void render ()

Renders template to output.

Implementation of:

Output
void  

line 454

setCacheStorage

public static void setCacheStorage ($storage)

Set cache storage.

Input
$storage
Output
void  

line 69

setFile

public void setFile (string $file)

Sets the path to the template file.

Implementation of:

Input
string $file template file path
Output
void  

line 338

setTranslator

public void setTranslator ([$translator = NULL])

Sets translate adapter.

Input
$translator
Output
void  

line 93

subTemplate

public Template subTemplate (string $file, [$params = NULL])

Creates subtemplate.

Input
string $file file name
$params parameters (optional)
Output
Template  

line 259

toXml

public SimpleXMLElement toXml ()

Converts to SimpleXML. (experimental)

Output
SimpleXMLElement  

line 314

__call

public mixed __call (string $name, array $args)

Call a template helper. Do not call directly.

Input
string $name helper name
array $args arguments
Output
mixed  

line 410

__get

public mixed & __get (string $name)

Returns a template parameter. Do not call directly.

Input
string $name name
Output
& mixed value

line 426

__isset

public bool __isset (string $name)

Determines whether parameter is defined. Do not call directly.

Input
string $name name
Output
bool  

line 398

__set

public void __set (string $name, mixed $value)

Sets a template parameter. Do not call directly.

Input
string $name name
mixed $value value
Output
void  

line 235

__toString

public string __toString (bool 0)

Renders template to string.

Input
bool 0 can throw exceptions? (hidden parameter)
Output
string  

line 438

__unset

public void __unset (string $name)

Removes a template parameter. Do not call directly.

Input
string $name name
Output
void