Namespaces

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

Classes

  • FileTemplate
  • Helpers
  • Template

Interfaces

  • IFileTemplate
  • ITemplate

Exceptions

  • FilterException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class Helpers

Template helpers.

Namespace: Nette\Templating
Author: David Grudl
Located at Templating/Helpers.php
Methods summary
public static callable
# loader( string $helper )

Try to load the requested helper.

Try to load the requested helper.

Parameters

$helper
string
helper name

Returns

callable
public static string
# escapeHtml( mixed $s, integer $quotes = ENT_QUOTES )

Escapes string for use inside HTML template.

Escapes string for use inside HTML template.

Parameters

$s
mixed
UTF-8 encoding
$quotes
integer
optional attribute quotes

Returns

string
public static string
# escapeHtmlComment( string $s )

Escapes string for use inside HTML comments.

Escapes string for use inside HTML comments.

Parameters

$s
string
UTF-8 encoding

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

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

Returns

string
public static string
# escapeJs( mixed $s )

Escapes variables for use inside <script>.

Escapes variables for use inside <script>.

Parameters

$s
mixed
UTF-8 encoding

Returns

string
public static string
# escapeICal( mixed $s )

Escapes string for use inside iCal template.

Escapes string for use inside iCal template.

Parameters

$s
mixed
UTF-8 encoding

Returns

string
public static string
# safeUrl( string $s )

Sanitizes string for use inside href attribute.

Sanitizes string for use inside href attribute.

Parameters

$s
string

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|DateInterval $time, string $format = NULL )

Date/time formatting.

Date/time formatting.

Parameters

$time
string|integer|DateTime|DateInterval
$format
string

Returns

string
public static Nette\DateTime
# modifyDate( string|integer|DateTime $time, string|integer $delta, string $unit = NULL )

Date/time modification.

Date/time modification.

Parameters

$time
string|integer|DateTime
$delta
string|integer
$unit
string

Returns

Nette\DateTime
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
# dataStream( string $data, string $type = NULL )

The data: URI generator.

The data: URI generator.

Parameters

$data
string
$type
string

Returns

string
public static string
# null( )

/dev/null.

/dev/null.

Returns

string
public static string
# nl2br( string $value )

Parameters

$value
string

Returns

string
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
Properties summary
public static string $dateFormat '%x'
#

default date format

default date format

Nette 2.1 API documentation generated by ApiGen 2.8.0