Packages

  • Nette
    • Application
    • Caching
    • Collections
    • Config
    • Forms
    • IO
    • Loaders
    • Mail
    • Reflection
    • Security
    • Templates
    • Web
  • None
  • PHP

Classes

  • NBaseTemplate
  • NCachingHelper
  • NCurlyBracketsMacros
  • NLatteFilter
  • NLatteMacros
  • NSnippetHelper
  • NTemplate
  • NTemplateCacheStorage
  • NTemplateFilters
  • NTemplateHelpers

Interfaces

  • IFileTemplate
  • ITemplate
  • Overview
  • Package
  • Class
  • Tree
  • Other releases

Class NTemplateHelpers

Standard template run-time helpers shipped with Nette Framework (https://nette.org)

Final
Package: Nette\Templates
Author: David Grudl
Located at Templates/Filters/TemplateHelpers.php
Methods summary
final public
# __construct( )

Static class - cannot be instantiated.

Static class - cannot be instantiated.

public static callback
# loader( string $helper )

Try to load the requested helper.

Try to load the requested helper.

Parameters

$helper
string
helper name

Returns

callback
public static string
# escapeHtml( mixed $s )

Escapes string for use inside HTML template.

Escapes string for use inside HTML template.

Parameters

$s
mixed
UTF-8 encoding or 8-bit

Returns

string
public static string
# escapeHtmlComment( mixed $s )

Escapes string for use inside HTML comments.

Escapes string for use inside HTML comments.

Parameters

$s
mixed
UTF-8 encoding or 8-bit

Returns

string
public static string
# escapeXML( string $s )

Escapes string for use inside XML 1.0 template.

Escapes string for use inside XML 1.0 template.

Parameters

$s
string
UTF-8 encoding or 8-bit

Returns

string
public static string
# escapeCss( string $s )

Escapes string for use inside CSS template.

Escapes string for use inside CSS template.

Parameters

$s
string
UTF-8 encoding or 8-bit

Returns

string
public static string
# escapeHtmlCss( string $s )

Escapes string for use inside HTML style attribute.

Escapes string for use inside HTML style attribute.

Parameters

$s
string
UTF-8 encoding or 8-bit

Returns

string
public static string
# escapeJs( mixed $s )

Escapes string for use inside JavaScript template.

Escapes string for use inside JavaScript template.

Parameters

$s
mixed
UTF-8 encoding

Returns

string
public static string
# escapeHtmlJs( mixed $s )

Escapes string for use inside HTML JavaScript attribute.

Escapes string for use inside HTML JavaScript attribute.

Parameters

$s
mixed
UTF-8 encoding

Returns

string
public static string
# strip( string $s )

Replaces all repeated white spaces with a single space.

Replaces all repeated white spaces with a single space.

Parameters

$s
string
UTF-8 encoding or 8-bit

Returns

string
public static string
# indent( string $s, integer $level = 1, string $chars = "\t" )

Indents the HTML content from the left.

Indents the HTML content from the left.

Parameters

$s
string
UTF-8 encoding or 8-bit
$level
integer
$chars
string

Returns

string
public static string
# date( string|integer|DateTime $time, string $format = "%x" )

Date/time formatting.

Date/time formatting.

Parameters

$time
string|integer|DateTime
$format
string

Returns

string
public static string
# bytes( integer $bytes, integer $precision = 2 )

Converts to human readable file size.

Converts to human readable file size.

Parameters

$bytes
integer
$precision
integer

Returns

string
public static integer
# length( mixed $var )

Returns array of string length.

Returns array of string length.

Parameters

$var
mixed

Returns

integer
public static string
# replace( string $subject, string $search, string $replacement = '' )

Performs a search and replace.

Performs a search and replace.

Parameters

$subject
string
$search
string
$replacement
string

Returns

string
public static string
# replaceRe( string $subject, string $pattern, string $replacement = '' )

Performs a regular expression search and replace.

Performs a regular expression search and replace.

Parameters

$subject
string
$pattern
string
$replacement
string

Returns

string
public static string
# null( mixed $value )

/dev/null.

/dev/null.

Parameters

$value
mixed

Returns

string
Nette Framework 0.9.7 (for PHP 5.2) API documentation generated by ApiGen 2.3.0