Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationLatte
      • ApplicationTracy
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsLatte
      • Framework
      • HttpTracy
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Templating
    • Utils
  • NetteModule
  • none
  • Tracy

Classes

  • CachingIterator
  • Filters
  • Html

Interfaces

  • IHtmlString
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated

Class Filters

Template filters.

Direct known subclasses

Nette\Templating\Helpers
Namespace: Latte\Runtime
Author: David Grudl
Located at Latte/Runtime/Filters.php
Methods summary
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 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 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, $replacement = '' )

Perform a regular expression search and replace.

Perform a regular expression search and replace.

Parameters

$subject
string
$pattern
string
$replacement

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
# nl2br( string $value )

Parameters

$value
string

Returns

string
public static string
# substring( string $s, integer $start, integer $length = NULL )

Returns a part of UTF-8 string.

Returns a part of UTF-8 string.

Parameters

$s
string
$start
integer
$length
integer

Returns

string
public static string
# truncate( string $s, integer $maxLen, string $append = "\xE2\x80\xA6" )

Truncates string to maximal length.

Truncates string to maximal length.

Parameters

$s
string
UTF-8 encoding
$maxLen
integer
$append
string
UTF-8 encoding

Returns

string
public static string
# lower( $s )

Convert to lower case.

Convert to lower case.

Returns

string
public static string
# upper( $s )

Convert to upper case.

Convert to upper case.

Returns

string
public static string
# firstUpper( $s )

Convert first character to upper case.

Convert first character to upper case.

Returns

string
public static string
# capitalize( $s )

Capitalize string.

Capitalize string.

Returns

string
public static integer
# length( $s )

Returns UTF-8 string length.

Returns UTF-8 string length.

Returns

integer
public static string
# trim( string $s, string $charlist = " \t\n\r\0\x0B\xC2\xA0" )

Strips whitespace.

Strips whitespace.

Parameters

$s
string
UTF-8 encoding
$charlist
string

Returns

string
public static string
# htmlAttributes( $attrs )

Returns element's attributes.

Returns element's attributes.

Returns

string
Properties summary
public static string $dateFormat '%x'
#

default date format

default date format

public static boolean $xhtml FALSE
#

use XHTML syntax?

use XHTML syntax?

Nette 2.2.2 API API documentation generated by ApiGen 2.8.0