Functions

Autoloader

smartyAutoload($class) 

Parameters

$class

Smarty {php}{/php} block function

smarty_php_tag(array $params, string $content, object $template, boolean $repeat) : string

Parameters

$params

array

parameter list

$content

string

contents of the block

$template

object

template object

$repeat

boolean

&$repeat repeat flag

Returns

stringcontent re-formatted

Classes and interfaces

Smarty

This is the main Smarty class

« More »

SmartyBC

Smarty Backward Compatability Wrapper Class

« More »

SmartyCompilerException

Smarty compiler exception class

« More »

SmartyException

Smarty exception class

« More »

Constants

 

DS

DS 
 

SMARTY_DIR

SMARTY_DIR 
 

SMARTY_MBSTRING

SMARTY_MBSTRING 
 

SMARTY_PLUGINS_DIR

SMARTY_PLUGINS_DIR 
 

SMARTY_RESOURCE_CHAR_SET

SMARTY_RESOURCE_CHAR_SET 
 

SMARTY_RESOURCE_DATE_FORMAT

SMARTY_RESOURCE_DATE_FORMAT 
 

SMARTY_SPL_AUTOLOAD

SMARTY_SPL_AUTOLOAD 
 

SMARTY_SYSPLUGINS_DIR

SMARTY_SYSPLUGINS_DIR 

Classes and interfaces

Smarty_CacheResource

Cache Handler API

« More »

Smarty_CacheResource_Custom

Cache Handler API

« More »

Smarty_CacheResource_KeyValueStore

Smarty Cache Handler Base for Key/Value Storage Implementations

« More »

Smarty_Internal_CacheResource_File

This class does contain all necessary methods for the HTML cache on file system

« More »

Classes and interfaces

Smarty_Internal_CompileBase

This class does extend all internal compile plugins

« More »

Smarty_Internal_Compile_Append

Smarty Internal Plugin Compile Append Class

« More »

Smarty_Internal_Compile_Assign

Smarty Internal Plugin Compile Assign Class

« More »

Smarty_Internal_Compile_Block

Smarty Internal Plugin Compile Block Class

« More »

Smarty_Internal_Compile_Blockclose

Smarty Internal Plugin Compile BlockClose Class

« More »

Smarty_Internal_Compile_Break

Smarty Internal Plugin Compile Break Class

« More »

Smarty_Internal_Compile_Call

Smarty Internal Plugin Compile Function_Call Class

« More »

Smarty_Internal_Compile_Capture

Smarty Internal Plugin Compile Capture Class

« More »

Smarty_Internal_Compile_CaptureClose

Smarty Internal Plugin Compile Captureclose Class

« More »

Smarty_Internal_Compile_Config_Load

Smarty Internal Plugin Compile Config Load Class

« More »

Smarty_Internal_Compile_Continue

Smarty Internal Plugin Compile Continue Class

« More »

Smarty_Internal_Compile_Debug

Smarty Internal Plugin Compile Debug Class

« More »

Smarty_Internal_Compile_Else

Smarty Internal Plugin Compile Else Class

« More »

Smarty_Internal_Compile_Elseif

Smarty Internal Plugin Compile ElseIf Class

« More »

Smarty_Internal_Compile_Eval

Smarty Internal Plugin Compile Eval Class

« More »

Smarty_Internal_Compile_Extends

Smarty Internal Plugin Compile extend Class

« More »

Smarty_Internal_Compile_For

Smarty Internal Plugin Compile For Class

« More »

Smarty_Internal_Compile_Forclose

Smarty Internal Plugin Compile Forclose Class

« More »

Smarty_Internal_Compile_Foreach

Smarty Internal Plugin Compile Foreach Class

« More »

Smarty_Internal_Compile_Foreachclose

Smarty Internal Plugin Compile Foreachclose Class

« More »

Smarty_Internal_Compile_Foreachelse

Smarty Internal Plugin Compile Foreachelse Class

« More »

Smarty_Internal_Compile_Forelse

Smarty Internal Plugin Compile Forelse Class

« More »

Smarty_Internal_Compile_Function

Smarty Internal Plugin Compile Function Class

« More »

Smarty_Internal_Compile_Functionclose

Smarty Internal Plugin Compile Functionclose Class

« More »

Smarty_Internal_Compile_If

Smarty Internal Plugin Compile If Class

« More »

Smarty_Internal_Compile_Ifclose

Smarty Internal Plugin Compile Ifclose Class

« More »

Smarty_Internal_Compile_Include

Smarty Internal Plugin Compile Include Class

« More »

Smarty_Internal_Compile_Include_Php

Smarty Internal Plugin Compile Insert Class

« More »

Smarty_Internal_Compile_Insert

Smarty Internal Plugin Compile Insert Class

« More »

Smarty_Internal_Compile_Ldelim

Smarty Internal Plugin Compile Ldelim Class

« More »

Smarty_Internal_Compile_Nocache

Smarty Internal Plugin Compile Nocache Classv

« More »

Smarty_Internal_Compile_Nocacheclose

Smarty Internal Plugin Compile Nocacheclose Class

« More »

Smarty_Internal_Compile_Private_Block_Plugin

Smarty Internal Plugin Compile Block Plugin Class

« More »

Smarty_Internal_Compile_Private_Function_Plugin

Smarty Internal Plugin Compile Function Plugin Class

« More »

Smarty_Internal_Compile_Private_Modifier

Smarty Internal Plugin Compile Modifier Class

« More »

Smarty_Internal_Compile_Private_Object_Block_Function

Smarty Internal Plugin Compile Object Block Function Class

« More »

Smarty_Internal_Compile_Private_Object_Function

Smarty Internal Plugin Compile Object Function Class

« More »

Smarty_Internal_Compile_Private_Print_Expression

Smarty Internal Plugin Compile Print Expression Class

« More »

Smarty_Internal_Compile_Private_Registered_Block

Smarty Internal Plugin Compile Registered Block Class

« More »

Smarty_Internal_Compile_Private_Registered_Function

Smarty Internal Plugin Compile Registered Function Class

« More »

Smarty_Internal_Compile_Private_Special_Variable

Smarty Internal Plugin Compile special Smarty Variable Class

« More »

Smarty_Internal_Compile_Rdelim

Smarty Internal Plugin Compile Rdelim Class

« More »

Smarty_Internal_Compile_Section

Smarty Internal Plugin Compile Section Class

« More »

Smarty_Internal_Compile_Sectionclose

Smarty Internal Plugin Compile Sectionclose Class

« More »

Smarty_Internal_Compile_Sectionelse

Smarty Internal Plugin Compile Sectionelse Class

« More »

Smarty_Internal_Compile_Setfilter

Smarty Internal Plugin Compile Setfilter Class

« More »

Smarty_Internal_Compile_Setfilterclose

Smarty Internal Plugin Compile Setfilterclose Class

« More »

Smarty_Internal_Compile_While

Smarty Internal Plugin Compile While Class

« More »

Smarty_Internal_Compile_Whileclose

Smarty Internal Plugin Compile Whileclose Class

« More »

Smarty_Internal_Nocache_Insert

Smarty Internal Plugin Compile Insert Class

« More »

Smarty_Internal_SmartyTemplateCompiler

Class SmartyTemplateCompiler

« More »

Smarty_Internal_TemplateCompilerBase

Main abstract compiler class

« More »

TPC_yyToken

Smarty Internal Plugin Configfileparser

« More »

TP_yyToken

Smarty Internal Plugin Templateparser

« More »

Classes and interfaces

Smarty_Internal_Config_File_Compiler

Main config file compiler class

« More »

Functions

Smarty debug_print_var modifier plugin

smarty_modifier_debug_print_var(array | object $var, integer $depth, integer $length) : string

Type: modifier
Name: debug_print_var
Purpose: formats variable contents for display in the console

author Monte Ohrt <monte at ohrt dot com>

Parameters

$var

arrayobject

variable to be formatted

$depth

integer

maximum recursion depth if $var is an array

$length

integer

maximum string length if $var is a string

Returns

string

Classes and interfaces

Smarty_Internal_Debug

Smarty Internal Plugin Debug Class

« More »

Functions

Smarty {php}{/php} block plugin

smarty_block_php($params, string $content, object $template, $repeat) : string

Parameters

$params

$content

string

contents of the block

$template

object

template object

$repeat

Returns

stringcontent re-formatted

Smarty {textformat}{/textformat} block plugin

smarty_block_textformat(array $params, string $content, \Smarty_Internal_Template $template, boolean $repeat) : string

Type: block function
Name: textformat
Purpose: format text a certain way with preset styles or custom wrap/indent settings
Params:

- style         - string (email)
- indent        - integer (0)
- wrap          - integer (80)
- wrap_char     - string ("\n")
- indent_char   - string (" ")
- wrap_boundary - boolean (true)
link {textformat} (Smarty online manual)
author Monte Ohrt <monte at ohrt dot com>

Parameters

$params

array

parameters

$content

string

contents of the block

$template

\Smarty_Internal_Template

template object

$repeat

boolean

&$repeat repeat flag

Returns

stringcontent re-formatted

Functions

Smarty trimwhitespace outputfilter plugin

smarty_outputfilter_trimwhitespace(string $source, \Smarty_Internal_Template $smarty) : string

Trim unnecessary whitespace from HTML markup.

author Rodney Rehm
todo substr_replace() is not overloaded by mbstring.func_overload - so this function might fail!

Parameters

$source

string

input string

$smarty

\Smarty_Internal_Template

Smarty object

Returns

stringfiltered output

Smarty htmlspecialchars variablefilter plugin

smarty_variablefilter_htmlspecialchars(string $source, \Smarty_Internal_Template $smarty) : string

Parameters

$source

string

input string

$smarty

\Smarty_Internal_Template

Smarty object

Returns

stringfiltered output

Functions

Smarty {counter} function plugin

smarty_function_counter(array $params, \Smarty_Internal_Template $template) : string | null

Type: function
Name: counter
Purpose: print out a counter value

author Monte Ohrt <monte at ohrt dot com>
link {counter} (Smarty online manual)

Parameters

$params

array

parameters

$template

\Smarty_Internal_Template

template object

Returns

stringnull

Smarty {cycle} function plugin

smarty_function_cycle(array $params, \Smarty_Internal_Template $template) : string | null

Type: function
Name: cycle
Date: May 3, 2002
Purpose: cycle through given values
Params:

- name      - name of cycle (optional)
- values    - comma separated list of values to cycle, or an array of values to cycle
              (this can be left out for subsequent calls)
- reset     - boolean - resets given var to true
- print     - boolean - print var or not. default is true
- advance   - boolean - whether or not to advance the cycle
- delimiter - the value delimiter, default is ","
- assign    - boolean, assigns to template var instead of printed.

Examples:

{cycle values="#eeeeee,#d0d0d0d"}
{cycle name=row values="one,two,three" reset=true}
{cycle name=row}
link {cycle} (Smarty online manual)
author Monte Ohrt <monte at ohrt dot com>
author credit to Mark Priatel
author credit to Gerard
author credit to Jason Sweat
version 1.3

Parameters

$params

array

parameters

$template

\Smarty_Internal_Template

template object

Returns

stringnull

Smarty {fetch} plugin

smarty_function_fetch(array $params, \Smarty_Internal_Template $template) : string | null

Type: function
Name: fetch
Purpose: fetch file, web or ftp data and display results

link {fetch} (Smarty online manual)
author Monte Ohrt <monte at ohrt dot com>

Parameters

$params

array

parameters

$template

\Smarty_Internal_Template

template object

Returns

stringnullif the assign parameter is passed, Smarty assigns the result to a template variable

Smarty {html_checkboxes} function plugin

smarty_function_html_checkboxes(array $params, object $template) : string

File: function.html_checkboxes.php
Type: function
Name: html_checkboxes
Date: 24.Feb.2003
Purpose: Prints out a list of checkbox input types
Examples:

{html_checkboxes values=$ids output=$names}
{html_checkboxes values=$ids name='box' separator='
' output=$names} {html_checkboxes values=$ids checked=$checked separator='
' output=$names}

Params:

- name       (optional) - string default "checkbox"
- values     (required) - array
- options    (optional) - associative array
- checked    (optional) - array default not set
- separator  (optional) - ie 
or   - output (optional) - the output next to each checkbox - assign (optional) - assign the output as an array to this variable - escape (optional) - escape the content (not value), defaults to true
link {html_checkboxes} (Smarty online manual)
author Christopher Kvarme
author credits to Monte Ohrt <monte at ohrt dot com>
version 1.0
uses \global\smarty_function_escape_special_chars()

Parameters

$params

array

parameters

$template

object

template object

Returns

string

smarty_function_html_checkboxes_output()

smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape) 

Parameters

$name

$value

$output

$selected

$extra

$separator

$labels

$label_ids

$escape

Smarty {html_image} function plugin

smarty_function_html_image(array $params, \Smarty_Internal_Template $template) : string

Type: function
Name: html_image
Date: Feb 24, 2003
Purpose: format HTML tags for the image
Examples: {html_image file="/images/masthead.gif"}
Output:
Params:

- file        - (required) - file (and path) of image
- height      - (optional) - image height (default actual height)
- width       - (optional) - image width (default actual width)
- basedir     - (optional) - base directory for absolute paths, default is environment variable DOCUMENT_ROOT
- path_prefix - prefix for path output (optional, default empty)
link {html_image} (Smarty online manual)
author Monte Ohrt <monte at ohrt dot com>
author credits to Duda
version 1.0
uses \global\smarty_function_escape_special_chars()

Parameters

$params

array

parameters

$template

\Smarty_Internal_Template

template object

Returns

string

Smarty {html_options} function plugin

smarty_function_html_options(array $params, \Smarty_Internal_Template $template) : string

Type: function
Name: html_options
Purpose: Prints the list of

- name       (optional) - string default "select"
- values     (required) - if no options supplied) - array
- options    (required) - if no values supplied) - associative array
- selected   (optional) - string default not set
- output     (required) - if not options supplied) - array
- id         (optional) - string default not set
- class      (optional) - string default not set
link {html_image} (Smarty online manual)
author Monte Ohrt <monte at ohrt dot com>
author Ralf Strehle (minor optimization) <ralf dot strehle at yahoo dot de>
uses \global\smarty_function_escape_special_chars()

Parameters

$params

array

parameters

$template

\Smarty_Internal_Template

template object

Returns

string

smarty_function_html_options_optgroup()

smarty_function_html_options_optgroup($key, $values, $selected, $id, $class, $idx) 

Parameters

$key

$values

$selected

$id

$class

$idx

smarty_function_html_options_optoutput()

smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, $idx) 

Parameters

$key

$value

$selected

$id

$class

$idx

Smarty {html_radios} function plugin

smarty_function_html_radios(array $params, \Smarty_Internal_Template $template) : string

File: function.html_radios.php
Type: function
Name: html_radios
Date: 24.Feb.2003
Purpose: Prints out a list of radio input types
Params:

- name       (optional) - string default "radio"
- values     (required) - array
- options    (required) - associative array
- checked    (optional) - array default not set
- separator  (optional) - ie 
or   - output (optional) - the output next to each radio button - assign (optional) - assign the output as an array to this variable - escape (optional) - escape the content (not value), defaults to true

Examples:

{html_radios values=$ids output=$names}
{html_radios values=$ids name='box' separator='
' output=$names} {html_radios values=$ids checked=$checked separator='
' output=$names}
link {html_radios} (Smarty online manual)
author Christopher Kvarme
author credits to Monte Ohrt <monte at ohrt dot com>
version 1.0
uses \global\smarty_function_escape_special_chars()

Parameters

$params

array

parameters

$template

\Smarty_Internal_Template

template object

Returns

string

smarty_function_html_radios_output()

smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape) 

Parameters

$name

$value

$output

$selected

$extra

$separator

$labels

$label_ids

$escape

Smarty {html_select_date} plugin

smarty_function_html_select_date(array $params, \Smarty_Internal_Template $template) : string

Type: function
Name: html_select_date
Purpose: Prints the dropdowns for date selection.

ChangeLog:

           - 1.0 initial release
           - 1.1 added support for +/- N syntax for begin
             and end year values. (Monte)
           - 1.2 added support for yyyy-mm-dd syntax for
             time value. (Jan Rosier)
           - 1.3 added support for choosing format for
             month values (Gary Loescher)
           - 1.3.1 added support for choosing format for
             day values (Marcus Bointon)
           - 1.3.2 support negative timestamps, force year
             dropdown to include given date unless explicitly set (Monte)
           - 1.3.4 fix behaviour of 0000-00-00 00:00:00 dates to match that
             of 0000-00-00 dates (cybot, boots)
           - 2.0 complete rewrite for performance,
             added attributes month_names, *_id
link {html_select_date} (Smarty online manual)
version 2.0
author Andrei Zmievski
author Monte Ohrt <monte at ohrt dot com>
author Rodney Rehm

Parameters

$params

array

parameters

$template

\Smarty_Internal_Template

template object

Returns

string

Smarty {html_select_time} function plugin

smarty_function_html_select_time(array $params, \Smarty_Internal_Template $template) : string

Type: function
Name: html_select_time
Purpose: Prints the dropdowns for time selection

link {html_select_time} (Smarty online manual)
author Roberto Berto
author Monte Ohrt <monte AT ohrt DOT com>
uses \global\smarty_make_timestamp()

Parameters

$params

array

parameters

$template

\Smarty_Internal_Template

template object

Returns

string

Smarty {html_table} function plugin

smarty_function_html_table(array $params, \Smarty_Internal_Template $template) : string

Type: function
Name: html_table
Date: Feb 17, 2003
Purpose: make an html table from an array of data
Params:

- loop       - array to loop through
- cols       - number of columns, comma separated list of column names
               or array of column names
- rows       - number of rows
- table_attr - table attributes
- th_attr    - table heading attributes (arrays are cycled)
- tr_attr    - table row attributes (arrays are cycled)
- td_attr    - table cell attributes (arrays are cycled)
- trailpad   - value to pad trailing cells with
- caption    - text for caption element
- vdir       - vertical direction (default: "down", means top-to-bottom)
- hdir       - horizontal direction (default: "right", means left-to-right)
- inner      - inner loop (default "cols": print $loop line by line,
               $loop will be printed column by column otherwise)

Examples:

{table loop=$data}
{table loop=$data cols=4 tr_attr='"bgcolor=red"'}
{table loop=$data cols="first,second,third" tr_attr=$colors}
author Monte Ohrt <monte at ohrt dot com>
author credit to Messju Mohr <messju at lammfellpuschen dot de>
author credit to boots <boots dot smarty at yahoo dot com>
version 1.1
link {html_table} (Smarty online manual)

Parameters

$params

array

parameters

$template

\Smarty_Internal_Template

template object

Returns

string

smarty_function_html_table_cycle()

smarty_function_html_table_cycle($name, $var, $no) 

Parameters

$name

$var

$no

Smarty {mailto} function plugin

smarty_function_mailto(array $params, \Smarty_Internal_Template $template) : string

Type: function
Name: mailto
Date: May 21, 2002 Purpose: automate mailto address link creation, and optionally encode them.
Params:

- address    - (required) - e-mail address
- text       - (optional) - text to display, default is address
- encode     - (optional) - can be one of:
                            * none : no encoding (default)
                            * javascript : encode with javascript
                            * javascript_charcode : encode with javascript charcode
                            * hex : encode with hexidecimal (no javascript)
- cc         - (optional) - address(es) to carbon copy
- bcc        - (optional) - address(es) to blind carbon copy
- subject    - (optional) - e-mail subject
- newsgroups - (optional) - newsgroup(s) to post to
- followupto - (optional) - address(es) to follow up to
- extra      - (optional) - extra tags for the href link

Examples:

{mailto address="me@domain.com"}
{mailto address="me@domain.com" encode="javascript"}
{mailto address="me@domain.com" encode="hex"}
{mailto address="me@domain.com" subject="Hello to you!"}
{mailto address="me@domain.com" cc="you@domain.com,they@domain.com"}
{mailto address="me@domain.com" extra='class="mailto"'}
link {mailto} (Smarty online manual)
version 1.2
author Monte Ohrt <monte at ohrt dot com>
author credits to Jason Sweat (added cc, bcc and subject functionality)

Parameters

$params

array

parameters

$template

\Smarty_Internal_Template

template object

Returns

string

Smarty {math} function plugin

smarty_function_math(array $params, \Smarty_Internal_Template $template) : string | null

Type: function
Name: math
Purpose: handle math computations in template

link {math} (Smarty online manual)
author Monte Ohrt <monte at ohrt dot com>

Parameters

$params

array

parameters

$template

\Smarty_Internal_Template

template object

Returns

stringnull

Classes and interfaces

Smarty_Internal_Filter_Handler

Class for filter processing

« More »

Smarty_Internal_Function_Call_Handler

This class does call function defined with the {function} tag

« More »

Smarty_Internal_Get_Include_Path

Smarty Internal Read Include Path Class

« More »

Smarty_Internal_Wrapper

Project: Smarty: the PHP compiling template engine File: smarty_internal_wrapper.php SVN: $Id: smarty_internal_wrapper.php 2755 2012-07-25 20:10:28Z xmurrix $

« More »

Smarty_Internal_Write_File

Smarty Internal Write File Class

« More »

Functions

Smarty capitalize modifier plugin

smarty_modifier_capitalize(string $string, boolean $uc_digits, boolean $lc_rest) : string

Type: modifier
Name: capitalize
Purpose: capitalize words in the string

author Monte Ohrt <monte at ohrt dot com>
author Rodney Rehm

Parameters

$string

string

string to capitalize

$uc_digits

boolean

also capitalize "x123" to "X123"

$lc_rest

boolean

capitalize first letters, lowercase all following letters "aAa" to "Aaa"

Returns

stringcapitalized string

Smarty date_format modifier plugin

smarty_modifier_date_format(string $string, string $format, string $default_date, string $formatter) : string

Type: modifier
Name: date_format
Purpose: format datestamps via strftime
Input:
- string: input date string - format: strftime format for output - default_date: default date if $string is empty

link date_format (Smarty online manual)
author Monte Ohrt <monte at ohrt dot com>
uses \global\smarty_make_timestamp()

Parameters

$string

string

input date string

$format

string

strftime format for output

$default_date

string

default date if $string is empty

$formatter

string

either 'strftime' or 'auto'

Returns

string|void

Smarty escape modifier plugin

smarty_modifier_escape(string $string, string $esc_type, string $char_set, boolean $double_encode) : string

Type: modifier
Name: escape
Purpose: escape string for output

link count_characters (Smarty online manual)
author Monte Ohrt <monte at ohrt dot com>

Parameters

$string

string

input string

$esc_type

string

escape type

$char_set

string

character set, used for htmlspecialchars() or htmlentities()

$double_encode

boolean

encode already encoded entitites again, used for htmlspecialchars() or htmlentities()

Returns

stringescaped input string

Smarty regex_replace modifier plugin

smarty_modifier_regex_replace(string $string, string | array $search, string | array $replace) : string

Type: modifier
Name: regex_replace
Purpose: regular expression search/replace

link regex_replace (Smarty online manual)
author Monte Ohrt <monte at ohrt dot com>

Parameters

$string

string

input string

$search

stringarray

regular expression(s) to search for

$replace

stringarray

string(s) that should be replaced

Returns

string

Smarty replace modifier plugin

smarty_modifier_replace(string $string, string $search, string $replace) : string

Type: modifier
Name: replace
Purpose: simple search/replace

link replace (Smarty online manual)
author Monte Ohrt <monte at ohrt dot com>
author Uwe Tews

Parameters

$string

string

input string

$search

string

text to search for

$replace

string

replacement text

Returns

string

Smarty spacify modifier plugin

smarty_modifier_spacify(string $string, string $spacify_char) : string

Type: modifier
Name: spacify
Purpose: add spaces between characters in a string

link spacify (Smarty online manual)
author Monte Ohrt <monte at ohrt dot com>

Parameters

$string

string

input string

$spacify_char

string

string to insert between characters.

Returns

string

Smarty truncate modifier plugin

smarty_modifier_truncate(string $string, integer $length, string $etc, boolean $break_words, boolean $middle) : string

Type: modifier
Name: truncate
Purpose: Truncate a string to a certain length if necessary, optionally splitting in the middle of a word, and appending the $etc string or inserting $etc into the middle.

link truncate (Smarty online manual)
author Monte Ohrt <monte at ohrt dot com>

Parameters

$string

string

input string

$length

integer

length of truncated text

$etc

string

end string

$break_words

boolean

truncate at word boundary

$middle

boolean

truncate in the middle of text

Returns

stringtruncated string

Functions

Smarty cat modifier plugin

smarty_modifiercompiler_cat(array $params, $compiler) : string

Type: modifier
Name: cat
Date: Feb 24, 2003
Purpose: catenate a value to a variable
Input: string to catenate
Example: {$var|cat:"foo"}

link cat (Smarty online manual)
author Uwe Tews

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty count_characters modifier plugin

smarty_modifiercompiler_count_characters(array $params, $compiler) : string

Type: modifier
Name: count_characteres
Purpose: count the number of characters in a text

link count_characters (Smarty online manual)
author Uwe Tews

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty count_paragraphs modifier plugin

smarty_modifiercompiler_count_paragraphs(array $params, $compiler) : string

Type: modifier
Name: count_paragraphs
Purpose: count the number of paragraphs in a text

link count_paragraphs (Smarty online manual)
author Uwe Tews

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty count_sentences modifier plugin

smarty_modifiercompiler_count_sentences(array $params, $compiler) : string

Type: modifier
Name: count_sentences Purpose: count the number of sentences in a text

link count_sentences (Smarty online manual)
author Uwe Tews

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty count_words modifier plugin

smarty_modifiercompiler_count_words(array $params, $compiler) : string

Type: modifier
Name: count_words
Purpose: count the number of words in a text

link count_words (Smarty online manual)
author Uwe Tews

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty default modifier plugin

smarty_modifiercompiler_default(array $params, $compiler) : string

Type: modifier
Name: default
Purpose: designate default value for empty variables

link default (Smarty online manual)
author Uwe Tews

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty escape modifier plugin

smarty_modifiercompiler_escape(array $params, $compiler) : string

Type: modifier
Name: escape
Purpose: escape string for output

link count_characters (Smarty online manual)
author Rodney Rehm

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty from_charset modifier plugin

smarty_modifiercompiler_from_charset(array $params, $compiler) : string

Type: modifier
Name: from_charset
Purpose: convert character encoding from $charset to internal encoding

author Rodney Rehm

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty indent modifier plugin

smarty_modifiercompiler_indent(array $params, $compiler) : string

Type: modifier
Name: indent
Purpose: indent lines of text

link indent (Smarty online manual)
author Uwe Tews

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty lower modifier plugin

smarty_modifiercompiler_lower(array $params, $compiler) : string

Type: modifier
Name: lower
Purpose: convert string to lowercase

link lower (Smarty online manual)
author Monte Ohrt <monte at ohrt dot com>
author Uwe Tews

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty noprint modifier plugin

smarty_modifiercompiler_noprint(array $params, $compiler) : string

Type: modifier
Name: noprint
Purpose: return an empty string

author Uwe Tews

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty string_format modifier plugin

smarty_modifiercompiler_string_format(array $params, $compiler) : string

Type: modifier
Name: string_format
Purpose: format strings via sprintf

link string_format (Smarty online manual)
author Uwe Tews

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty strip modifier plugin

smarty_modifiercompiler_strip(array $params, $compiler) : string

Type: modifier
Name: strip
Purpose: Replace all repeated spaces, newlines, tabs with a single space or supplied replacement string.
Example: {$var|strip} {$var|strip:" "}
Date: September 25th, 2002

link strip (Smarty online manual)
author Uwe Tews

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty strip_tags modifier plugin

smarty_modifiercompiler_strip_tags(array $params, $compiler) : string

Type: modifier
Name: strip_tags
Purpose: strip html tags from text

link strip_tags (Smarty online manual)
author Uwe Tews

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty to_charset modifier plugin

smarty_modifiercompiler_to_charset(array $params, $compiler) : string

Type: modifier
Name: to_charset
Purpose: convert character encoding from internal encoding to $charset

author Rodney Rehm

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty unescape modifier plugin

smarty_modifiercompiler_unescape(array $params, $compiler) : string

Type: modifier
Name: unescape
Purpose: unescape html entities

author Rodney Rehm

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty upper modifier plugin

smarty_modifiercompiler_upper(array $params, $compiler) : string

Type: modifier
Name: lower
Purpose: convert string to uppercase

link lower (Smarty online manual)
author Uwe Tews

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Smarty wordwrap modifier plugin

smarty_modifiercompiler_wordwrap(array $params, $compiler) : string

Type: modifier
Name: wordwrap
Purpose: wrap a string of text at a given length

link wordwrap (Smarty online manual)
author Uwe Tews

Parameters

$params

array

parameters

$compiler

Returns

stringwith compiled code

Functions

escape_special_chars common function

smarty_function_escape_special_chars(string $string) : string

Function: smarty_function_escape_special_chars
Purpose: used by other smarty functions to escape special chars except for already escaped ones

author Monte Ohrt <monte at ohrt dot com>

Parameters

$string

string

text that should by escaped

Returns

string

escape_special_chars common function

smarty_function_escape_special_chars(string $string) : string

Function: smarty_function_escape_special_chars
Purpose: used by other smarty functions to escape special chars except for already escaped ones

author Monte Ohrt <monte at ohrt dot com>

Parameters

$string

string

text that should by escaped

Returns

string

evaluate compiler parameter

smarty_literal_compiler_param(array $params, integer $index, mixed $default) : mixed
author Rodney Rehm

Parameters

$params

array

parameter array as given to the compiler function

$index

integer

array index of the parameter to convert

$default

mixed

value to be returned if the parameter is not present

Exceptions

\SmartyException if parameter is not a literal (but an expression, variable, …)

Returns

mixedevaluated value of parameter or $default

Function: smarty_make_timestamp<br> Purpose: used by other smarty functions to make a timestamp from a string.

smarty_make_timestamp(\DateTime | int | string $string) : int
author Monte Ohrt <monte at ohrt dot com>

Parameters

$string

\DateTimeintstring

date object, timestamp or string that can be converted using strtotime()

Returns

int

convert unicodes to the character of given encoding

smarty_mb_from_unicode(integer | array $unicode, string $encoding) : string
link for inspiration
author Rodney Rehm

Parameters

$unicode

integerarray

single unicode or list of unicodes to convert

$encoding

string

encoding of returned string, if null mb_internal_encoding() is used

Returns

stringunicode as character sequence in given $encoding

Multibyte string replace

smarty_mb_str_replace(string $search, string $replace, string $subject, int $count) : string
author Rodney Rehm

Parameters

$search

string

the string to be searched

$replace

string

the replacement string

$subject

string

the source string

$count

int

&$count number of matches found

Returns

stringreplaced string

convert characters to their decimal unicode equivalents

smarty_mb_to_unicode(string $string, string $encoding) : array
link for inspiration
author Rodney Rehm

Parameters

$string

string

characters to calculate unicode of

$encoding

string

encoding of $string, if null mb_internal_encoding() is used

Returns

arraysequence of unicodes

Wrap a string to a given number of characters

smarty_mb_wordwrap(string $str, int $width, string $break, boolean $cut) : string
link for similarity
author Rodney Rehm

Parameters

$str

string

the string to wrap

$width

int

the width of the output

$break

string

the character used to break the line

$cut

boolean

ignored parameter, just for the sake of

Returns

stringwrapped string

Classes and interfaces

Smarty_Internal_Utility

Utility class

« More »

Classes and interfaces

Smarty_Data

class for the Smarty data object

« More »

Smarty_Internal_Data

Base class with template and variable methodes

« More »

Smarty_Internal_Template

Main class with template data structures and methods

« More »

Smarty_Internal_TemplateBase

Class with shared template methodes

« More »

Smarty_Variable

class for the Smarty variable object

« More »

Undefined_Smarty_Variable

class for undefined variable object

« More »

Classes and interfaces

Smarty_Config_Source

Smarty Resource Data Object

« More »

Smarty_Internal_Resource_Eval

Smarty Internal Plugin Resource Eval

« More »

Smarty_Internal_Resource_Extends

Smarty Internal Plugin Resource Extends

« More »

Smarty_Internal_Resource_File

Smarty Internal Plugin Resource File

« More »

Smarty_Internal_Resource_PHP

Smarty Internal Plugin Resource PHP

« More »

Smarty_Internal_Resource_Registered

Smarty Internal Plugin Resource Registered

« More »

Smarty_Internal_Resource_Stream

Smarty Internal Plugin Resource Stream

« More »

Smarty_Internal_Resource_String

Smarty Internal Plugin Resource String

« More »

Smarty_Resource

Smarty Resource Plugin

« More »

Smarty_Resource_Custom

Smarty Resource Plugin

« More »

Smarty_Resource_Recompiled

Smarty Resource Plugin

« More »

Smarty_Resource_Uncompiled

Smarty Resource Plugin

« More »

Smarty_Template_Cached

Smarty Resource Data Object

« More »

Smarty_Template_Compiled

Smarty Resource Data Object

« More »

Smarty_Template_Source

Smarty Resource Data Object

« More »