Built-in Functions
{* we don't want to print a div tag unless content is displayed *} {capture name=banner} {include file='get_banner.tpl'} {/capture} {if $smarty.capture.banner ne ''} <div id="banner">{$smarty.capture.banner}</div> {/if}
Example 7.2. {capture} into a template variable This example also demonstrates the {popup} function {capture name=some_content assign=popText} The server is {$smarty.server.SERVER_NAME|upper} at {$smarty.server.SERVER_ADDR}<br> Your ip is {$smarty.server.REMOTE_ADDR}. {/capture} <a href="#" {popup caption='Server Info' text=$popText}>help</a>
See also $smarty.capture, {eval}, {fetch}, fetch() and {assign}.
{config_load} {config_load} is used for loading config #variables# from a configuration file into the template.
Attribute Name
Type
Required
Default
file
string
Yes
n/a
The name of the config file to include
section
string
No
n/a
The name of the section to load
scope
string
no
local
How the scope of the loaded variables are treated, which must be one of local, parent or global. local means variables are loaded into the local template context. parent means variables are loaded into both the local context and the parent template that called it. global means variables are available to all templates.
global
boolean
No
No
Whether or not variables are visible to the parent template, same as scope=parent. NOTE: This attribute is deprecated by the scope attribute, but still supported. If scope is
42
Description