Class BaseTemplate (namespace Nette\Templates)


Template.

Object
   |
   --BaseTemplate

Implements interfaces:

Direct Known Sub-classes:

Copyright: Copyright (c) 2004, 2010 David Grudl
Abstract:
Located: in /Templates/BaseTemplate.php (line 21)
Public Method Summary
void
add (string $name, mixed $value)
Adds new template parameter.
array
Returns all registered compile-time filters.
array
Returns all registered run-time helpers.
array
Returns array of all parameters.
static string
optimizePhp (string $source)
Removes unnecessary blocks of PHP code.
void
registerFilter (callback $callback)
Registers callback as template compile-time filter.
void
registerHelper (string $name, callback $callback)
Registers callback as template run-time helper.
void
registerHelperLoader (callback $callback)
Registers callback as template run-time helpers loader.
abstract void
render ()
Renders template to output.
BaseTemplate
setParams ($params)
Sets all parameters.
BaseTemplate
setTranslator ([$translator = NULL])
Sets translate adapter.
mixed
__call (string $name, array $args)
Call a template run-time 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.
Protected Method Summary
protected string
compile (string $content, [string $label = NULL])
Applies filters on template content.
Methods Inherited From Object
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Variable Summary
array $onPrepareFilters array()

line 27

of function(BaseTemplate $sender); Occurs before a template is compiled - implement to customize the filters
bool $warnOnUndefined TRUE

line 24


Method Details

line 228

add

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

Adds new template parameter.

Input
string $name name
mixed $value value
Output
void  

line 115

compile

protected string compile (string $content, [string $label = NULL])

Applies filters on template content.

Input
string $content
string $label
Output
string  

line 63

getFilters

public array getFilters ()

Returns all registered compile-time filters.

Output
array  

line 173

getHelpers

public array getHelpers ()

Returns all registered run-time helpers.

Output
array  

line 256

getParams

public array getParams ()

Returns array of all parameters.

Output
array  

line 361

optimizePhp

public static string optimizePhp (string $source)

Removes unnecessary blocks of PHP code.

Input
string $source
Output
string  

line 48

registerFilter

public void registerFilter (callback $callback)

Registers callback as template compile-time filter.

Input
callback $callback
Output
void  

line 150

registerHelper

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

Registers callback as template run-time helper.

Input
string $name
callback $callback
Output
void  

line 162

registerHelperLoader

public void registerHelperLoader (callback $callback)

Registers callback as template run-time helpers loader.

Input
callback $callback
Output
void  

line 79

render

public abstract void render ()

Renders template to output.

Overridden in child classes as:

Implementation of:

Output
void  
Tags
Abstract

line 244

setParams

public BaseTemplate setParams ($params)

Sets all parameters.

Input
$params
Output
BaseTemplate provides a fluent interface

line 210

setTranslator

public BaseTemplate setTranslator ([$translator = NULL])

Sets translate adapter.

Input
$translator
Output
BaseTemplate provides a fluent interface

line 186

__call

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

Call a template run-time helper. Do not call directly.

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

line 281

__get

public mixed & __get (string $name)

Returns a template parameter. Do not call directly.

Input
string $name name
Output
& mixed value

line 297

__isset

public bool __isset (string $name)

Determines whether parameter is defined. Do not call directly.

Input
string $name name
Output
bool  

line 269

__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 90

__toString

public string __toString (bool 0)

Renders template to string.

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

line 309

__unset

public void __unset (string $name)

Removes a template parameter. Do not call directly.

Input
string $name name
Output
void