Class TemplateHelpers (namespace Nette\Templates)
Standard template run-time helpers shipped with Nette Framework.
Public Method Summary | |
---|---|
TemplateHelpers |
__construct
()
Static class - cannot be instantiated.
|
static string |
bytes
(int $bytes, [int $precision =
2 ])
Converts to human readable file size.
|
static string |
date
(string|int|DateTime $time, [string $format =
"%x" ])
Date/time formatting.
|
static string |
escapeCss
(string $s)
Escapes string for use inside CSS template.
|
static string |
escapeHtml
(mixed $s)
Escapes string for use inside HTML template.
|
static string |
escapeHtmlComment
(mixed $s)
Escapes string for use inside HTML comments.
|
static string |
escapeHtmlCss
(string $s)
Escapes string for use inside HTML style attribute.
|
static string |
escapeHtmlJs
(mixed $s)
Escapes string for use inside HTML JavaScript attribute.
|
static string |
escapeJs
(mixed $s)
Escapes string for use inside JavaScript template.
|
static string |
escapeXML
(string $s)
Escapes string for use inside XML 1.0 template.
|
static string |
Indents the HTML content from the left.
|
static int |
length
(mixed $var)
Returns array of string length.
|
static callback |
loader
(string $helper)
Try to load the requested helper.
|
static string |
null
(mixed $value)
/dev/null.
|
static string |
replace
(string $subject, string $search, [string $replacement =
'' ])
Performs a search and replace.
|
static string |
replaceRe
(string $subject, string $pattern, [string $replacement =
'' ])
Performs a regular expression search and replace.
|
static string |
strip
(string $s)
Replaces all repeated white spaces with a single space.
|
Method Details | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 27 __constructpublic TemplateHelpers __construct () Static class - cannot be instantiated.
|
||||||||||||||||||
line 208 bytespublic static string bytes (int $bytes, [int $precision = Converts to human readable file size.
|
||||||||||||||||||
line 188 datepublic static string date (string|int|DateTime $time, [string $format = Date/time formatting.
|
||||||||||||||||||
line 100 escapeCsspublic static string escapeCss (string $s) Escapes string for use inside CSS template.
|
||||||||||||||||||
line 58 escapeHtmlpublic static string escapeHtml (mixed $s) Escapes string for use inside HTML template.
|
||||||||||||||||||
line 73 escapeHtmlCommentpublic static string escapeHtmlComment (mixed $s) Escapes string for use inside HTML comments.
|
||||||||||||||||||
line 113 escapeHtmlCsspublic static string escapeHtmlCss (string $s) Escapes string for use inside HTML style attribute.
|
||||||||||||||||||
line 140 escapeHtmlJspublic static string escapeHtmlJs (mixed $s) Escapes string for use inside HTML JavaScript attribute.
|
||||||||||||||||||
line 125 escapeJspublic static string escapeJs (mixed $s) Escapes string for use inside JavaScript template.
|
||||||||||||||||||
line 86 escapeXMLpublic static string escapeXML (string $s) Escapes string for use inside XML 1.0 template.
|
||||||||||||||||||
line 170 indentpublic static string indent (string $s, [int $level = Indents the HTML content from the left.
|
||||||||||||||||||
line 226 lengthpublic static int length (mixed $var) Returns array of string length.
|
||||||||||||||||||
line 39 loaderpublic static callback loader (string $helper) Try to load the requested helper.
|
||||||||||||||||||
line 266 nullpublic static string null (mixed $value) /dev/null.
|
||||||||||||||||||
line 240 replacepublic static string replace (string $subject, string $search, [string $replacement = Performs a search and replace.
|
||||||||||||||||||
line 254 replaceRepublic static string replaceRe (string $subject, string $pattern, [string $replacement = Performs a regular expression search and replace.
|
||||||||||||||||||
line 152 strippublic static string strip (string $s) Replaces all repeated white spaces with a single space.
|