Smarty


Functions


Function Summary
void

_smarty_regex_replace_check(mixed search)

string

smarty_block_textformat(mixed params, mixed content, mixed smarty, array

, string contents, Smarty clever)

Smarty {textformat}{/textformat} block pluginType: block function Name: textformat Purpose: format text a certain way with preset styles or custom wrap/indent settings

void

smarty_compiler_assign(mixed tag_attrs, mixed compiler, string containing, Smarty_Compiler )

Smarty {assign} compiler function pluginType: compiler function Name: assign Purpose: assign a value to a template variable

string|false

smarty_core_assemble_plugin_filepath(mixed params, mixed smarty, string type, string name)

assemble filepath of requested plugin

void

smarty_core_assign_smarty_interface(mixed params, mixed smarty, array Format:, Smarty )

Smarty assign_smarty_interface core pluginType: core Name: assign_smarty_interface Purpose: assign the $smarty interface variable

void

smarty_core_create_dir_structure(mixed params, mixed smarty, string dir)

create full directory structure

void

smarty_core_display_debug_console(mixed params, mixed smarty, array Format:, Smarty )

Smarty debug_console function pluginType: core Name: display_debug_console Purpose: display the javascript debug console window

boolean

smarty_core_get_include_path(mixed params, mixed smarty, string file_path, string new_file_path)

Get path to file from include_path

double

smarty_core_get_microtime(mixed params, mixed smarty)

Get seconds and microseconds

boolean

smarty_core_get_php_resource(mixed params, mixed smarty, string resource, string resource_type, $php_resource )

Retrieves PHP script resourcesets $php_resource to the returned resource

boolean

smarty_core_is_secure(mixed params, mixed smarty, string resource_type, string resource_name)

determines if a resource is secure or not.

boolean

smarty_core_is_trusted(mixed params, mixed smarty, string resource_type, string resource_name)

determines if a resource is trusted or not

void

smarty_core_load_plugins(mixed params, mixed smarty, array plugins)

Load requested plugins

void

smarty_core_load_resource_plugin(mixed params, mixed smarty, string type)

load a resource plugin

string

smarty_core_process_cached_inserts(mixed params, mixed smarty, string results)

Replace cached inserts with the actual results

boolean

smarty_core_read_cache_file(mixed params, mixed smarty, string tpl_file, string cache_id, string compile_id, string results)

read a cache file, determine if it needs to be regenerated or not

boolean

smarty_core_rm_auto(mixed params, mixed smarty, string auto_base, string auto_source, string auto_id, integer exp_time)

delete an automagically created file by name and id

boolean

smarty_core_rmdir(mixed params, mixed smarty, string dirname, integer level, integer exp_time)

delete a dir recursively (level=0 -> keep root) WARNING: no tests, it will try to remove what you tell it!

string

smarty_core_run_insert_handler(mixed params, mixed smarty, array args)

Handle insert tags

void

smarty_core_smarty_include_php(mixed params, mixed smarty, string smarty_file, string smarty_assign, boolean smarty_once, array smarty_include_vars)

called for included php files within templates

true|null

smarty_core_write_cache_file(mixed params, mixed smarty, string tpl_file, string cache_id, string compile_id, string results)

Prepend the cache information to the cache file and write it

boolean

smarty_core_write_file(mixed params, mixed smarty, string filename, string contents, boolean create_dirs)

write out a file to disk

void

smarty_function_assign_debug_info(mixed params, mixed smarty, array unused, Smarty )

Smarty {assign_debug_info} function pluginType: function Name: assign_debug_info Purpose: assign debug info to the template

void

smarty_function_config_load(mixed params, mixed smarty, array Format:, Smarty )

Smarty {config_load} function pluginType: function Name: config_load Purpose: load config file vars

string|null

smarty_function_counter(mixed params, mixed smarty, array parameters, Smarty )

Smarty {counter} function pluginType: function Name: counter Purpose: print out a counter value

string|null

smarty_function_cycle(mixed params, mixed smarty, Smarty )

Smarty {cycle} function pluginType: function Name: cycle Date: May 3, 2002 Purpose: cycle through given values Input: - 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.

string

smarty_function_debug(mixed params, mixed smarty, Smarty )

Smarty {debug} function pluginType: function Name: debug Date: July 1, 2002 Purpose: popup debug window

string

smarty_function_escape_special_chars(mixed string, string )

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

void

smarty_function_eval(mixed params, mixed smarty, Smarty )

Smarty {eval} function pluginType: function Name: eval Purpose: evaluate a template variable as a template

string|null

smarty_function_fetch(mixed params, mixed smarty, Smarty )

Smarty {fetch} pluginType: function Name: fetch Purpose: fetch file, web or ftp data and display results

string

smarty_function_html_checkboxes(mixed params, mixed smarty, Smarty )

Smarty {html_checkboxes} function pluginFile: function.html_checkboxes.php Type: function Name: html_checkboxes Date: 24.Feb.2003 Purpose: Prints out a list of checkbox input types Input: - 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 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}

void

smarty_function_html_checkboxes_output(mixed name, mixed value, mixed output, mixed selected, mixed extra, mixed separator, mixed labels)

string

smarty_function_html_image(mixed params, mixed smarty, Smarty )

Smarty {html_image} function pluginType: function Name: html_image Date: Feb 24, 2003 Purpose: format HTML tags for the image Input: - file = file (and path) of image (required) - height = image height (optional, default actual height) - width = image width (optional, default actual width) - basedir = base directory for absolute paths, default is environment variable DOCUMENT_ROOT - path_prefix = prefix for path output (optional, default empty)Examples: {html_image file="/images/masthead.gif"} Output:

string

smarty_function_html_options(mixed params, mixed smarty, Smarty )

Smarty {html_options} function pluginType: function Name: html_options Input: - 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 Purpose: Prints the list of tags generated from the passed parameters

void

smarty_function_html_options_optgroup(mixed key, mixed values, mixed selected)

void

smarty_function_html_options_optoutput(mixed key, mixed value, mixed selected)

string

smarty_function_html_radios(mixed params, mixed smarty, Smarty )

Smarty {html_radios} function pluginFile: function.html_radios.php Type: function Name: html_radios Date: 24.Feb.2003 Purpose: Prints out a list of radio input types Input: - name (optional) - string default "radio" - values (required) - array - options (optional) - 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 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}

void

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

string

smarty_function_html_select_date(mixed params, mixed smarty, Smarty )

Smarty {html_select_date} pluginType: function Name: html_select_date Purpose: Prints the dropdowns for date selection.

string

smarty_function_html_select_time(mixed params, mixed smarty, Smarty )

Smarty {html_select_time} function pluginType: function Name: html_select_time Purpose: Prints the dropdowns for time selection

string

smarty_function_html_table(mixed params, mixed smarty, Smarty )

Smarty {html_table} function pluginType: function Name: html_table Date: Feb 17, 2003 Purpose: make an html table from an array of data Input: - 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}

void

smarty_function_html_table_cycle(mixed name, mixed var, mixed no)

string

smarty_function_mailto(mixed params, mixed smarty, Smarty )

Smarty {mailto} function pluginType: function Name: mailto Date: May 21, 2002 Purpose: automate mailto address link creation, and optionally encode them. Input: - address = 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 linkExamples: {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"'}

string

smarty_function_math(mixed params, mixed smarty, Smarty )

Smarty {math} function pluginType: function Name: math Purpose: handle math computations in template

string

smarty_function_popup(mixed params, mixed smarty, Smarty )

Smarty {popup} function pluginType: function Name: popup Purpose: make text pop up in windows via overlib

string

smarty_function_popup_init(mixed params, mixed smarty, Smarty )

Smarty {popup_init} function pluginType: function Name: popup_init Purpose: initialize overlib

string

smarty_make_timestamp(mixed string, string )

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

string

smarty_modifier_capitalize(mixed string, mixed uc_digits, string )

Smarty capitalize modifier pluginType: modifier Name: capitalize Purpose: capitalize words in the string

void

smarty_modifier_capitalize_ucfirst(mixed string, mixed uc_digits)

string

smarty_modifier_cat(mixed string, mixed cat, string )

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

integer

smarty_modifier_count_characters(mixed string, mixed include_spaces, string , boolean include)

Smarty count_characters modifier pluginType: modifier Name: count_characteres Purpose: count the number of characters in a text

integer

smarty_modifier_count_paragraphs(mixed string, string )

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

integer

smarty_modifier_count_sentences(mixed string, string )

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

integer

smarty_modifier_count_words(mixed string, string )

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

string|void

smarty_modifier_date_format(mixed string, mixed format, mixed default_date, string )

Smarty date_format modifier pluginType: 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

string

smarty_modifier_debug_print_var(mixed var, mixed depth, mixed length, integer )

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

string

smarty_modifier_default(mixed string, mixed default, string )

Smarty default modifier pluginType: modifier Name: default Purpose: designate default value for empty variables

string

smarty_modifier_escape(mixed string, mixed esc_type, mixed char_set, html|htmlall|url|quotes|hex|hexentity|javascript )

Smarty escape modifier pluginType: modifier Name: escape Purpose: Escape the string according to escapement type

string

smarty_modifier_indent(mixed string, mixed chars, mixed char, string )

Smarty indent modifier pluginType: modifier Name: indent Purpose: indent lines of text

string

smarty_modifier_lower(mixed string, string )

Smarty lower modifier pluginType: modifier Name: lower Purpose: convert string to lowercase

string

smarty_modifier_nl2br(mixed string, string )

Smarty pluginType: modifier Name: nl2br Date: Feb 26, 2003 Purpose: convert \r\n, \r or \n to Input: - contents = contents to replace - preceed_test = if true, includes preceeding break tags in replacement Example: {$text|nl2br}

string

smarty_modifier_regex_replace(mixed string, mixed search, mixed replace, string|array )

Smarty regex_replace modifier pluginType: modifier Name: regex_replace Purpose: regular expression search/replace

string

smarty_modifier_replace(mixed string, mixed search, mixed replace, string )

Smarty replace modifier pluginType: modifier Name: replace Purpose: simple search/replace

string

smarty_modifier_spacify(mixed string, mixed spacify_char, string )

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

string

smarty_modifier_string_format(mixed string, mixed format, string )

Smarty string_format modifier pluginType: modifier Name: string_format Purpose: format strings via sprintf

string

smarty_modifier_strip(mixed text, mixed replace, string )

Smarty strip modifier pluginType: 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

string

smarty_modifier_strip_tags(mixed string, mixed replace_with_space, boolean )

Smarty strip_tags modifier pluginType: modifier Name: strip_tags Purpose: strip html tags from text

string

smarty_modifier_truncate(mixed string, mixed length, mixed etc, mixed break_words, mixed middle, boolean )

Smarty truncate modifier pluginType: 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.

string

smarty_modifier_upper(mixed string, string )

Smarty upper modifier pluginType: modifier Name: upper Purpose: convert string to uppercase

string

smarty_modifier_wordwrap(mixed string, mixed length, mixed break, mixed cut, boolean )

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

void

smarty_outputfilter_trimwhitespace(mixed source, mixed smarty, Smarty )

Smarty trimwhitespace outputfilter pluginFile: outputfilter.trimwhitespace.php Type: outputfilter Name: trimwhitespace Date: Jan 25, 2003 Purpose: trim leading white space and blank lines from template source after it gets interpreted, cleaning up code and saving bandwidth.

void

smarty_outputfilter_trimwhitespace_replace(mixed search_str, mixed replace, mixed subject)

Function Detail

plugins/modifier.regex_replace.php at line 35

_smarty_regex_replace_check

public void _smarty_regex_replace_check(mixed search)

plugins/block.textformat.php at line 31

smarty_block_textformat

public string smarty_block_textformat(mixed params, mixed content, mixed smarty, array
, string contents, Smarty clever)

Smarty {textformat}{/textformat} block plugin

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

See Also:
{textformat} (Smarty online manual)
Parameters:
 - Params: style: string (email) indent: integer (0) wrap: integer (80) wrap_char string ("\n") indent_char: string (" ") wrap_boundary: boolean (true) 
contents - of the block
clever - simulation of a method
Author:
Monte Ohrt
Returns:
string $content re-formatted

plugins/compiler.assign.php at line 21

smarty_compiler_assign

public void smarty_compiler_assign(mixed tag_attrs, mixed compiler, string containing, Smarty_Compiler )

Smarty {assign} compiler function plugin

Type: compiler function
Name: assign
Purpose: assign a value to a template variable

See Also:
{assign} (Smarty online manual)
Author:
Monte Ohrt (initial author)
messju mohr (conversion to compiler function)
Parameters:
containing - var-attribute and value-attribute

internals/core.assemble_plugin_filepath.php at line 15

smarty_core_assemble_plugin_filepath

public string|false smarty_core_assemble_plugin_filepath(mixed params, mixed smarty, string type, string name)

assemble filepath of requested plugin


internals/core.assign_smarty_interface.php at line 17

smarty_core_assign_smarty_interface

public void smarty_core_assign_smarty_interface(mixed params, mixed smarty, array Format:, Smarty )

Smarty assign_smarty_interface core plugin

Type: core
Name: assign_smarty_interface
Purpose: assign the $smarty interface variable

Parameters:
Format: - null

internals/core.create_dir_structure.php at line 16

smarty_core_create_dir_structure

public void smarty_core_create_dir_structure(mixed params, mixed smarty, string dir)

create full directory structure


internals/core.display_debug_console.php at line 17

smarty_core_display_debug_console

public void smarty_core_display_debug_console(mixed params, mixed smarty, array Format:, Smarty )

Smarty debug_console function plugin

Type: core
Name: display_debug_console
Purpose: display the javascript debug console window

Parameters:
Format: - null

internals/core.get_include_path.php at line 19

smarty_core_get_include_path

public boolean smarty_core_get_include_path(mixed params, mixed smarty, string file_path, string new_file_path)

Get path to file from include_path

Staticvar:
array|null

internals/core.get_microtime.php at line 12

smarty_core_get_microtime

public double smarty_core_get_microtime(mixed params, mixed smarty)

Get seconds and microseconds


internals/core.get_php_resource.php at line 18

smarty_core_get_php_resource

public boolean smarty_core_get_php_resource(mixed params, mixed smarty, string resource, string resource_type, $php_resource )

Retrieves PHP script resource

sets $php_resource to the returned resource


internals/core.is_secure.php at line 18

smarty_core_is_secure

public boolean smarty_core_is_secure(mixed params, mixed smarty, string resource_type, string resource_name)

determines if a resource is secure or not.


internals/core.is_trusted.php at line 18

smarty_core_is_trusted

public boolean smarty_core_is_trusted(mixed params, mixed smarty, string resource_type, string resource_name)

determines if a resource is trusted or not


internals/core.load_plugins.php at line 16

smarty_core_load_plugins

public void smarty_core_load_plugins(mixed params, mixed smarty, array plugins)

Load requested plugins


internals/core.load_resource_plugin.php at line 16

smarty_core_load_resource_plugin

public void smarty_core_load_resource_plugin(mixed params, mixed smarty, string type)

load a resource plugin


internals/core.process_cached_inserts.php at line 14

smarty_core_process_cached_inserts

public string smarty_core_process_cached_inserts(mixed params, mixed smarty, string results)

Replace cached inserts with the actual results


internals/core.read_cache_file.php at line 21

smarty_core_read_cache_file

public boolean smarty_core_read_cache_file(mixed params, mixed smarty, string tpl_file, string cache_id, string compile_id, string results)

read a cache file, determine if it needs to be regenerated or not


internals/core.rm_auto.php at line 20

smarty_core_rm_auto

public boolean smarty_core_rm_auto(mixed params, mixed smarty, string auto_base, string auto_source, string auto_id, integer exp_time)

delete an automagically created file by name and id


internals/core.rmdir.php at line 20

smarty_core_rmdir

public boolean smarty_core_rmdir(mixed params, mixed smarty, string dirname, integer level, integer exp_time)

delete a dir recursively (level=0 -> keep root) WARNING: no tests, it will try to remove what you tell it!


internals/core.run_insert_handler.php at line 14

smarty_core_run_insert_handler

public string smarty_core_run_insert_handler(mixed params, mixed smarty, array args)

Handle insert tags


internals/core.smarty_include_php.php at line 21

smarty_core_smarty_include_php

public void smarty_core_smarty_include_php(mixed params, mixed smarty, string smarty_file, string smarty_assign, boolean smarty_once, array smarty_include_vars)

called for included php files within templates

Parameters:
smarty_assign - variable to assign the included template's output into
smarty_once - uses include_once if this is true
smarty_include_vars - associative array of vars from {include file="blah" var=$var}

internals/core.write_cache_file.php at line 21

smarty_core_write_cache_file

public true|null smarty_core_write_cache_file(mixed params, mixed smarty, string tpl_file, string cache_id, string compile_id, string results)

Prepend the cache information to the cache file and write it


internals/core.write_file.php at line 16

smarty_core_write_file

public boolean smarty_core_write_file(mixed params, mixed smarty, string filename, string contents, boolean create_dirs)

write out a file to disk


plugins/function.assign_debug_info.php at line 19

smarty_function_assign_debug_info

public void smarty_function_assign_debug_info(mixed params, mixed smarty, array unused, Smarty )

Smarty {assign_debug_info} function plugin

Type: function
Name: assign_debug_info
Purpose: assign debug info to the template

Author:
Monte Ohrt
Parameters:
unused - in this plugin, this plugin uses {@link Smarty::$_config}, {@link Smarty::$_tpl_vars} and {@link Smarty::$_smarty_debug_info}

plugins/function.config_load.php at line 27

smarty_function_config_load

public void smarty_function_config_load(mixed params, mixed smarty, array Format:, Smarty )

Smarty {config_load} function plugin

Type: function
Name: config_load
Purpose: load config file vars

See Also:
{config_load} (Smarty online manual)
Author:
Monte Ohrt
messju mohr (added use of resources)
Parameters:
Format: -
 array('file' => required config file name, 'section' => optional config file section to load 'scope' => local/parent/global 'global' => overrides scope, setting to parent if true) 

plugins/function.counter.php at line 22

smarty_function_counter

public string|null smarty_function_counter(mixed params, mixed smarty, array parameters, Smarty )

Smarty {counter} function plugin

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

Author:
Monte Ohrt
See Also:
{counter} (Smarty online manual)

plugins/function.cycle.php at line 44

smarty_function_cycle

public string|null smarty_function_cycle(mixed params, mixed smarty, Smarty )

Smarty {cycle} function plugin

Type: function
Name: cycle
Date: May 3, 2002
Purpose: cycle through given values
Input: - 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}

See Also:
{cycle} (Smarty online manual)
Author:
Monte Ohrt
credit to Mark Priatel
credit to Gerard
credit to Jason Sweat
Version:
1.3

plugins/function.debug.php at line 24

smarty_function_debug

public string smarty_function_debug(mixed params, mixed smarty, Smarty )

Smarty {debug} function plugin

Type: function
Name: debug
Date: July 1, 2002
Purpose: popup debug window

See Also:
{debug} (Smarty online manual)
Author:
Monte Ohrt
Version:
1.0
Returns:
output from {@link Smarty::_generate_debug_output()}

plugins/shared.escape_special_chars.php at line 19

smarty_function_escape_special_chars

public string smarty_function_escape_special_chars(mixed string, string )

escape_special_chars common function

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

Author:
Monte Ohrt

plugins/function.eval.php at line 21

smarty_function_eval

public void smarty_function_eval(mixed params, mixed smarty, Smarty )

Smarty {eval} function plugin

Type: function
Name: eval
Purpose: evaluate a template variable as a template

See Also:
{eval} (Smarty online manual)
Author:
Monte Ohrt

plugins/function.fetch.php at line 23

smarty_function_fetch

public string|null smarty_function_fetch(mixed params, mixed smarty, Smarty )

Smarty {fetch} plugin

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

See Also:
{fetch} (Smarty online manual)
Author:
Monte Ohrt
Returns:
if the assign parameter is passed, Smarty assigns the result to a template variable

plugins/function.html_checkboxes.php at line 41

smarty_function_html_checkboxes

public string smarty_function_html_checkboxes(mixed params, mixed smarty, Smarty )

Smarty {html_checkboxes} function plugin

File: function.html_checkboxes.php
Type: function
Name: html_checkboxes
Date: 24.Feb.2003
Purpose: Prints out a list of checkbox input types
Input:
- 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 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}

See Also:
{html_checkboxes} (Smarty online manual)
Author:
Christopher Kvarme
credits to Monte Ohrt
Version:
1.0
Uses:
smarty_function_escape_special_chars()

plugins/function.html_checkboxes.php at line 126

smarty_function_html_checkboxes_output

public void smarty_function_html_checkboxes_output(mixed name, mixed value, mixed output, mixed selected, mixed extra, mixed separator, mixed labels)

plugins/function.html_image.php at line 37

smarty_function_html_image

public string smarty_function_html_image(mixed params, mixed smarty, Smarty )

Smarty {html_image} function plugin

Type: function
Name: html_image
Date: Feb 24, 2003
Purpose: format HTML tags for the image
Input:
- file = file (and path) of image (required) - height = image height (optional, default actual height) - width = image width (optional, default actual width) - basedir = base directory for absolute paths, default is environment variable DOCUMENT_ROOT - path_prefix = prefix for path output (optional, default empty)

Examples: {html_image file="/images/masthead.gif"} Output:

See Also:
{html_image} (Smarty online manual)
Author:
Monte Ohrt
credits to Duda - wrote first image function in repository, helped with lots of functionality
Version:
1.0
Uses:
smarty_function_escape_special_chars()

plugins/function.html_options.php at line 30

smarty_function_html_options

public string smarty_function_html_options(mixed params, mixed smarty, Smarty )

Smarty {html_options} function plugin

Type: function
Name: html_options
Input:
- 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 Purpose: Prints the list of

See Also:
{html_image} (Smarty online manual)
Author:
Monte Ohrt
Uses:
smarty_function_escape_special_chars()

plugins/function.html_options.php at line 111

smarty_function_html_options_optgroup

public void smarty_function_html_options_optgroup(mixed key, mixed values, mixed selected)

plugins/function.html_options.php at line 98

smarty_function_html_options_optoutput

public void smarty_function_html_options_optoutput(mixed key, mixed value, mixed selected)

plugins/function.html_radios.php at line 41

smarty_function_html_radios

public string smarty_function_html_radios(mixed params, mixed smarty, Smarty )

Smarty {html_radios} function plugin

File: function.html_radios.php
Type: function
Name: html_radios
Date: 24.Feb.2003
Purpose: Prints out a list of radio input types
Input:
- name (optional) - string default "radio" - values (required) - array - options (optional) - 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 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}

See Also:
{html_radios} (Smarty online manual)
Author:
Christopher Kvarme
credits to Monte Ohrt
Version:
1.0
Uses:
smarty_function_escape_special_chars()

plugins/function.html_radios.php at line 130

smarty_function_html_radios_output

public void smarty_function_html_radios_output(mixed name, mixed value, mixed output, mixed selected, mixed extra, mixed separator, mixed labels, mixed label_ids)

plugins/function.html_select_date.php at line 38

smarty_function_html_select_date

public string smarty_function_html_select_date(mixed params, mixed smarty, Smarty )

Smarty {html_select_date} plugin

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)

See Also:
{html_select_date} (Smarty online manual)
Version:
1.3.4
Author:
Andrei Zmievski
Monte Ohrt

plugins/function.html_select_time.php at line 24

smarty_function_html_select_time

public string smarty_function_html_select_time(mixed params, mixed smarty, Smarty )

Smarty {html_select_time} function plugin

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

See Also:
{html_select_time} (Smarty online manual)
Author:
Roberto Berto
Credits:
Monte Ohrt
Uses:
smarty_make_timestamp()

plugins/function.html_table.php at line 49

smarty_function_html_table

public string smarty_function_html_table(mixed params, mixed smarty, Smarty )

Smarty {html_table} function plugin

Type: function
Name: html_table
Date: Feb 17, 2003
Purpose: make an html table from an array of data
Input:
- 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
credit to Messju Mohr
credit to boots
Version:
1.1
See Also:
{html_table} (Smarty online manual)

plugins/function.html_table.php at line 164

smarty_function_html_table_cycle

public void smarty_function_html_table_cycle(mixed name, mixed var, mixed no)

plugins/function.mailto.php at line 50

smarty_function_mailto

public string smarty_function_mailto(mixed params, mixed smarty, Smarty )

Smarty {mailto} function plugin

Type: function
Name: mailto
Date: May 21, 2002 Purpose: automate mailto address link creation, and optionally encode them.
Input:
- address = 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"'}

See Also:
{mailto} (Smarty online manual)
Version:
1.2
Author:
Monte Ohrt
credits to Jason Sweat (added cc, bcc and subject functionality)

plugins/function.math.php at line 22

smarty_function_math

public string smarty_function_math(mixed params, mixed smarty, Smarty )

Smarty {math} function plugin

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

See Also:
{math} (Smarty online manual)
Author:
Monte Ohrt

plugins/function.popup.php at line 22

smarty_function_popup

public string smarty_function_popup(mixed params, mixed smarty, Smarty )

Smarty {popup} function plugin

Type: function
Name: popup
Purpose: make text pop up in windows via overlib

See Also:
{popup} (Smarty online manual)
Author:
Monte Ohrt

plugins/function.popup_init.php at line 22

smarty_function_popup_init

public string smarty_function_popup_init(mixed params, mixed smarty, Smarty )

Smarty {popup_init} function plugin

Type: function
Name: popup_init
Purpose: initialize overlib

See Also:
{popup_init} (Smarty online manual)
Author:
Monte Ohrt

plugins/shared.make_timestamp.php at line 17

smarty_make_timestamp

public string smarty_make_timestamp(mixed string, string )

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

Author:
Monte Ohrt

plugins/modifier.capitalize.php at line 21

smarty_modifier_capitalize

public string smarty_modifier_capitalize(mixed string, mixed uc_digits, string )

Smarty capitalize modifier plugin

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

See Also:
capitalize (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.capitalize.php at line 27

smarty_modifier_capitalize_ucfirst

public void smarty_modifier_capitalize_ucfirst(mixed string, mixed uc_digits)

plugins/modifier.cat.php at line 26

smarty_modifier_cat

public string smarty_modifier_cat(mixed string, mixed cat, string )

Smarty cat modifier plugin

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

See Also:
cat (Smarty online manual)
Author:
Monte Ohrt
Version:
1.0

plugins/modifier.count_characters.php at line 22

smarty_modifier_count_characters

public integer smarty_modifier_count_characters(mixed string, mixed include_spaces, string , boolean include)

Smarty count_characters modifier plugin

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

See Also:
count_characters (Smarty online manual)
Author:
Monte Ohrt
Parameters:
include - whitespace in the character count

plugins/modifier.count_paragraphs.php at line 21

smarty_modifier_count_paragraphs

public integer smarty_modifier_count_paragraphs(mixed string, string )

Smarty count_paragraphs modifier plugin

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

See Also:
count_paragraphs (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.count_sentences.php at line 21

smarty_modifier_count_sentences

public integer smarty_modifier_count_sentences(mixed string, string )

Smarty count_sentences modifier plugin

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

See Also:
count_sentences (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.count_words.php at line 21

smarty_modifier_count_words

public integer smarty_modifier_count_words(mixed string, string )

Smarty count_words modifier plugin

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

See Also:
count_words (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.date_format.php at line 31

smarty_modifier_date_format

public string|void smarty_modifier_date_format(mixed string, mixed format, mixed default_date, string )

Smarty date_format modifier plugin

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

See Also:
date_format (Smarty online manual)
Author:
Monte Ohrt
Uses:
smarty_make_timestamp()

plugins/modifier.debug_print_var.php at line 23

smarty_modifier_debug_print_var

public string smarty_modifier_debug_print_var(mixed var, mixed depth, mixed length, integer )

Smarty debug_print_var modifier plugin

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

See Also:
debug_print_var (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.default.php at line 22

smarty_modifier_default

public string smarty_modifier_default(mixed string, mixed default, string )

Smarty default modifier plugin

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

See Also:
default (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.escape.php at line 22

smarty_modifier_escape

public string smarty_modifier_escape(mixed string, mixed esc_type, mixed char_set, html|htmlall|url|quotes|hex|hexentity|javascript )

Smarty escape modifier plugin

Type: modifier
Name: escape
Purpose: Escape the string according to escapement type

See Also:
escape (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.indent.php at line 23

smarty_modifier_indent

public string smarty_modifier_indent(mixed string, mixed chars, mixed char, string )

Smarty indent modifier plugin

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

See Also:
indent (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.lower.php at line 21

smarty_modifier_lower

public string smarty_modifier_lower(mixed string, string )

Smarty lower modifier plugin

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

See Also:
lower (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.nl2br.php at line 28

smarty_modifier_nl2br

public string smarty_modifier_nl2br(mixed string, string )

Smarty plugin

Type: modifier
Name: nl2br
Date: Feb 26, 2003 Purpose: convert \r\n, \r or \n to <
> Input:
- contents = contents to replace - preceed_test = if true, includes preceeding break tags in replacement Example: {$text|nl2br}

See Also:
nl2br (Smarty online manual)
Version:
1.0
Author:
Monte Ohrt

plugins/modifier.regex_replace.php at line 23

smarty_modifier_regex_replace

public string smarty_modifier_regex_replace(mixed string, mixed search, mixed replace, string|array )

Smarty regex_replace modifier plugin

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

See Also:
regex_replace (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.replace.php at line 23

smarty_modifier_replace

public string smarty_modifier_replace(mixed string, mixed search, mixed replace, string )

Smarty replace modifier plugin

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

See Also:
replace (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.spacify.php at line 22

smarty_modifier_spacify

public string smarty_modifier_spacify(mixed string, mixed spacify_char, string )

Smarty spacify modifier plugin

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

See Also:
spacify (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.string_format.php at line 22

smarty_modifier_string_format

public string smarty_modifier_string_format(mixed string, mixed format, string )

Smarty string_format modifier plugin

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

See Also:
string_format (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.strip.php at line 26

smarty_modifier_strip

public string smarty_modifier_strip(mixed text, mixed replace, string )

Smarty strip modifier plugin

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

See Also:
strip (Smarty online manual)
Author:
Monte Ohrt
Version:
1.0

plugins/modifier.strip_tags.php at line 22

smarty_modifier_strip_tags

public string smarty_modifier_strip_tags(mixed string, mixed replace_with_space, boolean )

Smarty strip_tags modifier plugin

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

See Also:
strip_tags (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.truncate.php at line 27

smarty_modifier_truncate

public string smarty_modifier_truncate(mixed string, mixed length, mixed etc, mixed break_words, mixed middle, boolean )

Smarty truncate modifier plugin

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.

See Also:
truncate (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.upper.php at line 21

smarty_modifier_upper

public string smarty_modifier_upper(mixed string, string )

Smarty upper modifier plugin

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

See Also:
upper (Smarty online manual)
Author:
Monte Ohrt

plugins/modifier.wordwrap.php at line 24

smarty_modifier_wordwrap

public string smarty_modifier_wordwrap(mixed string, mixed length, mixed break, mixed cut, boolean )

Smarty wordwrap modifier plugin

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

See Also:
wordwrap (Smarty online manual)
Author:
Monte Ohrt

plugins/outputfilter.trimwhitespace.php at line 28

smarty_outputfilter_trimwhitespace

public void smarty_outputfilter_trimwhitespace(mixed source, mixed smarty, Smarty )

Smarty trimwhitespace outputfilter plugin

File: outputfilter.trimwhitespace.php
Type: outputfilter
Name: trimwhitespace
Date: Jan 25, 2003
Purpose: trim leading white space and blank lines from template source after it gets interpreted, cleaning up code and saving bandwidth. Does not affect <

>
and blocks.
Install: Drop into the plugin directory, call $smarty->load_filter('output','trimwhitespace'); from application.

Author:
Monte Ohrt
Contributions from Lars Noschinski
Version:
1.3

plugins/outputfilter.trimwhitespace.php at line 64

smarty_outputfilter_trimwhitespace_replace

public void smarty_outputfilter_trimwhitespace_replace(mixed search_str, mixed replace, mixed subject)

Smarty