Packages

  • Nette
    • Application
      • Application\Diagnostics
      • Application\Responses
      • Application\Routers
      • Application\UI
    • Caching
      • Caching\Storages
    • ComponentModel
    • Config
    • Database
      • Database\Diagnostics
      • Database\Drivers
      • Database\Reflection
      • Database\Table
    • DI
    • Diagnostics
    • Forms
      • Forms\Controls
      • Forms\Rendering
    • Http
    • Iterators
    • Latte
      • Latte\Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
    • Templating
    • Utils
  • NetteModule
  • None
  • PHP

Classes

  • NFileTemplate
  • NTemplate
  • NTemplateHelpers

Interfaces

  • IFileTemplate
  • ITemplate

Exceptions

  • NTemplateException
  • Overview
  • Package
  • Class
  • Tree

Class NTemplate

Template.

NObject
Extended by NTemplate implements ITemplate

Direct known subclasses

NFileTemplate
Package: Nette\Templating
Author: David Grudl
Located at Templating/Template.php
Methods summary
public NTemplate
# setSource( string $source )

Sets template source code.

Sets template source code.

Parameters

$source
string

Returns

NTemplate
provides a fluent interface
public source
# getSource( )

Returns template source code.

Returns template source code.

Returns

source
public
# render( )

Renders template to output.

Renders template to output.

Implementation of

ITemplate::render
public
# save( string $file )

Renders template to file.

Renders template to file.

Parameters

$file
string
public string
# __toString( )

Renders template to string.

Renders template to string.

Returns

string
public string
# compile( )

Applies filters on template content.

Applies filters on template content.

Returns

string
public
# registerFilter( callback $callback )

Registers callback as template compile-time filter.

Registers callback as template compile-time filter.

Parameters

$callback
callback
final public array
# getFilters( )

Returns all registered compile-time filters.

Returns all registered compile-time filters.

Returns

array
public
# registerHelper( string $name, callback $callback )

Registers callback as template run-time helper.

Registers callback as template run-time helper.

Parameters

$name
string
$callback
callback
public
# registerHelperLoader( callback $callback )

Registers callback as template run-time helpers loader.

Registers callback as template run-time helpers loader.

Parameters

$callback
callback
final public array
# getHelpers( )

Returns all registered run-time helpers.

Returns all registered run-time helpers.

Returns

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

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

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

Parameters

$name
string
helper name
$args
array
arguments

Returns

mixed

Throws

MemberAccessException
public NTemplate
# setTranslator( ITranslator $translator = NULL )

Sets translate adapter.

Sets translate adapter.

Parameters

$translator
ITranslator

Returns

NTemplate
provides a fluent interface
public
# add( string $name, mixed $value )

Adds new template parameter.

Adds new template parameter.

Parameters

$name
string
name
$value
mixed
value
public NTemplate
# setParams( array $params )

Sets all parameters.

Sets all parameters.

Parameters

$params
array

Returns

NTemplate
provides a fluent interface
public array
# getParams( )

Returns array of all parameters.

Returns array of all parameters.

Returns

array
public
# __set( string $name, mixed $value )

Sets a template parameter. Do not call directly.

Sets a template parameter. Do not call directly.

Parameters

$name
string
name
$value
mixed
value

Throws

MemberAccessException
if the property is not defined or is read-only
public mixed &
# __get( string $name )

Returns a template parameter. Do not call directly.

Returns a template parameter. Do not call directly.

Parameters

$name
string
name

Returns

mixed
value

Throws

MemberAccessException
if the property is not defined.
public boolean
# __isset( string $name )

Determines whether parameter is defined. Do not call directly.

Determines whether parameter is defined. Do not call directly.

Parameters

$name
string
name

Returns

boolean
public
# __unset( string $name )

Removes a template parameter. Do not call directly.

Removes a template parameter. Do not call directly.

Parameters

$name
string
name

Throws

MemberAccessException
public
# setCacheStorage( ICacheStorage $storage )

Set cache storage.

Set cache storage.

Parameters

$storage
NCache
public ICacheStorage
# getCacheStorage( )

Returns

ICacheStorage
public static string
# optimizePhp( string $source, $lineLength = 80, $existenceOfThisParameterSolvesDamnBugInPHP535 = NULL )

Removes unnecessary blocks of PHP code.

Removes unnecessary blocks of PHP code.

Parameters

$source
string
$lineLength
$existenceOfThisParameterSolvesDamnBugInPHP535

Returns

string
Methods inherited from NObject
__callStatic(), extensionMethod(), getReflection()
Properties summary
public boolean $warnOnUndefined TRUE
#
public array $onPrepareFilters array()
#

of function(Template $sender); Occurs before a template is compiled - implement to customize the filters

of function(Template $sender); Occurs before a template is compiled - implement to customize the filters

Nette Framework 2.0beta1 (for PHP 5.2) API API documentation generated by ApiGen 2.3.0