Chapter 13. Methods

Table of Contents
append
append_by_ref
assign
assign_by_ref
clear_all_assign
clear_all_cache
clear_assign
clear_cache
clear_compiled_tpl
display
fetch
get_template_vars
is_cached
load_filter
register_block
register_compiler_function
register_function
register_modifier
register_outputfilter
register_postfilter
register_prefilter
register_resource
trigger_error
template_exists
unregister_block
unregister_compiler_function
unregister_function
unregister_modifier
unregister_outputfilter
unregister_postfilter
unregister_prefilter
unregister_resource

append

void append(mixed var)

void append(string varname, mixed var)

This is used to append data to variables in the template. You can explicitly pass name/value pairs, or associative arrays containing the name/value pairs.

Example 13-1. append

// passing name/value pairs
$smarty->append("Name","Fred");
$smarty->append("Address",$address);

// passing an associative array
$smarty->append(array("city" => "Lincoln","state" => "Nebraska"));