Smarty


Package Smarty

Class Summary
Config_FileConfig file reading class
Smarty
Smarty_CompilerTemplate compiling class
Function Summary
_smarty_regex_replace_check
smarty_block_textformatSmarty {textformat}{/textformat} block pluginType: block function Name: textformat Purpose: format text a certain way with preset styles or custom wrap/indent settings
smarty_compiler_assignSmarty {assign} compiler function pluginType: compiler function Name: assign Purpose: assign a value to a template variable
smarty_core_assemble_plugin_filepathassemble filepath of requested plugin
smarty_core_assign_smarty_interfaceSmarty assign_smarty_interface core pluginType: core Name: assign_smarty_interface Purpose: assign the $smarty interface variable
smarty_core_create_dir_structurecreate full directory structure
smarty_core_display_debug_consoleSmarty debug_console function pluginType: core Name: display_debug_console Purpose: display the javascript debug console window
smarty_core_get_include_pathGet path to file from include_path
smarty_core_get_microtimeGet seconds and microseconds
smarty_core_get_php_resourceRetrieves PHP script resourcesets $php_resource to the returned resource
smarty_core_is_securedetermines if a resource is secure or not.
smarty_core_is_trusteddetermines if a resource is trusted or not
smarty_core_load_pluginsLoad requested plugins
smarty_core_load_resource_pluginload a resource plugin
smarty_core_process_cached_insertsReplace cached inserts with the actual results
smarty_core_read_cache_fileread a cache file, determine if it needs to be regenerated or not
smarty_core_rm_autodelete an automagically created file by name and id
smarty_core_rmdirdelete a dir recursively (level=0 -> keep root) WARNING: no tests, it will try to remove what you tell it!
smarty_core_run_insert_handlerHandle insert tags
smarty_core_smarty_include_phpcalled for included php files within templates
smarty_core_write_cache_filePrepend the cache information to the cache file and write it
smarty_core_write_filewrite out a file to disk
smarty_function_assign_debug_infoSmarty {assign_debug_info} function pluginType: function Name: assign_debug_info Purpose: assign debug info to the template
smarty_function_config_loadSmarty {config_load} function pluginType: function Name: config_load Purpose: load config file vars
smarty_function_counterSmarty {counter} function pluginType: function Name: counter Purpose: print out a counter value
smarty_function_cycleSmarty {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.
smarty_function_debugSmarty {debug} function pluginType: function Name: debug Date: July 1, 2002 Purpose: popup debug window
smarty_function_escape_special_charsescape_special_chars common functionFunction: smarty_function_escape_special_chars Purpose: used by other smarty functions to escape special chars except for already escaped ones
smarty_function_evalSmarty {eval} function pluginType: function Name: eval Purpose: evaluate a template variable as a template
smarty_function_fetchSmarty {fetch} pluginType: function Name: fetch Purpose: fetch file, web or ftp data and display results
smarty_function_html_checkboxesSmarty {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}
smarty_function_html_checkboxes_output
smarty_function_html_imageSmarty {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:
smarty_function_html_optionsSmarty {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
smarty_function_html_options_optgroup
smarty_function_html_options_optoutput
smarty_function_html_radiosSmarty {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}
smarty_function_html_radios_output
smarty_function_html_select_dateSmarty {html_select_date} pluginType: function Name: html_select_date Purpose: Prints the dropdowns for date selection.
smarty_function_html_select_timeSmarty {html_select_time} function pluginType: function Name: html_select_time Purpose: Prints the dropdowns for time selection
smarty_function_html_tableSmarty {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}
smarty_function_html_table_cycle
smarty_function_mailtoSmarty {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"'}
smarty_function_mathSmarty {math} function pluginType: function Name: math Purpose: handle math computations in template
smarty_function_popupSmarty {popup} function pluginType: function Name: popup Purpose: make text pop up in windows via overlib
smarty_function_popup_initSmarty {popup_init} function pluginType: function Name: popup_init Purpose: initialize overlib
smarty_make_timestampFunction: smarty_make_timestamp Purpose: used by other smarty functions to make a timestamp from a string.
smarty_modifier_capitalizeSmarty capitalize modifier pluginType: modifier Name: capitalize Purpose: capitalize words in the string
smarty_modifier_capitalize_ucfirst
smarty_modifier_catSmarty 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"}
smarty_modifier_count_charactersSmarty count_characters modifier pluginType: modifier Name: count_characteres Purpose: count the number of characters in a text
smarty_modifier_count_paragraphsSmarty count_paragraphs modifier pluginType: modifier Name: count_paragraphs Purpose: count the number of paragraphs in a text
smarty_modifier_count_sentencesSmarty count_sentences modifier pluginType: modifier Name: count_sentences Purpose: count the number of sentences in a text
smarty_modifier_count_wordsSmarty count_words modifier pluginType: modifier Name: count_words Purpose: count the number of words in a text
smarty_modifier_date_formatSmarty 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
smarty_modifier_debug_print_varSmarty debug_print_var modifier pluginType: modifier Name: debug_print_var Purpose: formats variable contents for display in the console
smarty_modifier_defaultSmarty default modifier pluginType: modifier Name: default Purpose: designate default value for empty variables
smarty_modifier_escapeSmarty escape modifier pluginType: modifier Name: escape Purpose: Escape the string according to escapement type
smarty_modifier_indentSmarty indent modifier pluginType: modifier Name: indent Purpose: indent lines of text
smarty_modifier_lowerSmarty lower modifier pluginType: modifier Name: lower Purpose: convert string to lowercase
smarty_modifier_nl2brSmarty 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}
smarty_modifier_regex_replaceSmarty regex_replace modifier pluginType: modifier Name: regex_replace Purpose: regular expression search/replace
smarty_modifier_replaceSmarty replace modifier pluginType: modifier Name: replace Purpose: simple search/replace
smarty_modifier_spacifySmarty spacify modifier pluginType: modifier Name: spacify Purpose: add spaces between characters in a string
smarty_modifier_string_formatSmarty string_format modifier pluginType: modifier Name: string_format Purpose: format strings via sprintf
smarty_modifier_stripSmarty 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
smarty_modifier_strip_tagsSmarty strip_tags modifier pluginType: modifier Name: strip_tags Purpose: strip html tags from text
smarty_modifier_truncateSmarty 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.
smarty_modifier_upperSmarty upper modifier pluginType: modifier Name: upper Purpose: convert string to uppercase
smarty_modifier_wordwrapSmarty wordwrap modifier pluginType: modifier Name: wordwrap Purpose: wrap a string of text at a given length
smarty_outputfilter_trimwhitespaceSmarty 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.
smarty_outputfilter_trimwhitespace_replace
Global Summary
DIR_SEPDIR_SEP isn't used anymore, but third party apps might
SMARTY_CORE_DIR
SMARTY_DIRset SMARTY_DIR to absolute path to Smarty library files.
SMARTY_PHP_ALLOW
SMARTY_PHP_PASSTHRU
SMARTY_PHP_QUOTE
SMARTY_PHP_REMOVE
smartyInclude the {@link shared.make_timestamp.php} plugin

Smarty