Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api/caching/multiple-caches-per-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $smarty->display('index.tpl', $my_cache_id);


Above, we are passing the variable `$my_cache_id` to
[`display()`](#api.display) as the `$cache_id`. For each unique value of
[`display()`](../../programmers/api-functions/api-display.md) as the `$cache_id`. For each unique value of
`$my_cache_id`, a separate cache will be generated for `index.tpl`. In
this example, `article_id` was passed in the URL and is used as the
`$cache_id`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ The above example will output:



See also [`append()`](#api.append) and
[`getTemplateVars()`](#api.get.template.vars).
See also [`append()`](../../programmers/api-functions/api-append.md) and
[`getTemplateVars()`](../../programmers/api-functions/api-get-template-vars.md).
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ $smarty->assign('foo','Even smarter');
echo $smarty->getTemplateVars('foo');
```

The following functions can also *optionally* assign template variables: [`{capture}`](#language.function.capture),
[`{include}`](#language.function.include),
[`{counter}`](#language.function.counter),
[`{cycle}`](#language.function.cycle),
[`{eval}`](#language.function.eval),
[`{fetch}`](#language.function.fetch),
[`{math}`](#language.function.math) and
[`{textformat}`](#language.function.textformat).
The following functions can also *optionally* assign template variables: [`{capture}`](language-function-capture.md),
[`{include}`](language-function-include.md),
[`{counter}`](../language-custom-functions/language-function-counter.md),
[`{cycle}`](../language-custom-functions/language-function-cycle.md),
[`{eval}`](../language-custom-functions/language-function-eval.md),
[`{fetch}`](../language-custom-functions/language-function-fetch.md),
[`{math}`](../language-custom-functions/language-function-math.md) and
[`{textformat}`](../language-custom-functions/language-function-textformat.md).

See also [`{append}`](./language-function-append.md),
[`assign()`](#api.assign) and
[`getTemplateVars()`](#api.get.template.vars).
[`assign()`](../../programmers/api-functions/api-assign.md) and
[`getTemplateVars()`](../../programmers/api-functions/api-get-template-vars.md).
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# {config_load}

`{config_load}` is used for loading config
[`#variables#`](#language.config.variables) from a [configuration file](#config.files) into the template.
[`#variables#`](../language-variables/language-config-variables.md) from a [configuration file](../config-files.md) into the template.

## Attributes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nested menus.
> **Note**
>
> Template functions are defined global. Since the Smarty compiler is a
> single-pass compiler, The [`{call}`](#language.function.call) tag must
> single-pass compiler, The [`{call}`](language-function-call.md) tag must
> be used to call a template function defined externally from the given
> template. Otherwise, you can directly use the function as
> `{funcname ...}` in the template.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# to_charset

`to_charset` is used to transcode a string from the internal charset to
a given charset. This is the exact opposite of the [from_charset
modifier](#language.modifier.from_charset).
a given charset. This is the exact opposite of the
[from_charset modifier](language-modifier-from-charset.md).

## Parameters

Expand All @@ -16,5 +16,5 @@ modifier](#language.modifier.from_charset).
> modifier should only be used in cases where the application cannot
> anticipate that a certain string is required in another encoding.

See also [Configuring Smarty](../../api/configuring.md), [from_charset
modifier](language-modifier-from-charset.md).
See also [Configuring Smarty](../../api/configuring.md) and
[from_charset modifier](language-modifier-from-charset.md).
5 changes: 2 additions & 3 deletions docs/programmers/api-functions/api-add-plugins-dir.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,5 @@ plugins\_dir



See also [`getPluginsDir()`](#api.get.plugins.dir),
[`setPluginsDir()`](#api.set.plugins.dir) and
[`$plugins_dir`](#variable.plugins.dir).
See also [`getPluginsDir()`](../../programmers/api-functions/api-get-plugins-dir.md) and
[`setPluginsDir()`](../../programmers/api-functions/api-set-plugins-dir.md)
4 changes: 2 additions & 2 deletions docs/programmers/api-functions/api-append.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ NOTE.PARAMETER.MERGE



See also [`assign()`](#api.assign) and
[`getTemplateVars()`](#api.get.template.vars)
See also [`assign()`](../../programmers/api-functions/api-assign.md) and
[`getTemplateVars()`](../../programmers/api-functions/api-get-template-vars.md)
10 changes: 5 additions & 5 deletions docs/programmers/api-functions/api-assign.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ These are accessed in the template with
{$contact.id}, {$contact.name},{$contact.email}

To access more complex array assignments see
[`{foreach}`](#language.function.foreach) and
[`{section}`](#language.function.section)
[`{foreach}`](../../designers/language-builtin-functions/language-function-foreach.md) and
[`{section}`](../../designers/language-builtin-functions/language-function-section.md)

See also [`getTemplateVars()`](#api.get.template.vars),
[`clearAssign()`](#api.clear.assign), [`append()`](#api.append) and
[`{assign}`](#language.function.assign)
See also [`getTemplateVars()`](../../programmers/api-functions/api-get-template-vars.md),
[`clearAssign()`](../../programmers/api-functions/api-clear-assign.md), [`append()`](../../programmers/api-functions/api-append.md) and
[`{assign}`](../../designers/language-builtin-functions/language-function-assign.md)
9 changes: 5 additions & 4 deletions docs/programmers/api-functions/api-clear-all-assign.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ clearAllAssign



See also [`clearAssign()`](#api.clear.assign),
[`clearConfig()`](#api.clear.config),
[`getTemplateVars()`](#api.get.template.vars), [`assign()`](#api.assign)
and [`append()`](#api.append)
See also [`clearAssign()`](../../programmers/api-functions/api-clear-assign.md),
[`clearConfig()`](../../programmers/api-functions/api-clear-config.md),
[`getTemplateVars()`](../../programmers/api-functions/api-get-template-vars.md),
[`assign()`](../../programmers/api-functions/api-assign.md)
and [`append()`](../../programmers/api-functions/api-append.md)
4 changes: 2 additions & 2 deletions docs/programmers/api-functions/api-clear-all-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ cache files must be before they will get cleared.



See also [`clearCache()`](#api.clear.cache),
[`isCached()`](#api.is.cached) and the [caching](#caching) page.
See also [`clearCache()`](../../programmers/api-functions/api-clear-cache.md),
[`isCached()`](../../programmers/api-functions/api-is-cached.md) and the [caching](../../api/caching/basics.md) page.
9 changes: 5 additions & 4 deletions docs/programmers/api-functions/api-clear-assign.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ This can be a single value, or an array of values.



See also [`clearAllAssign()`](#api.clear.all.assign),
[`clearConfig()`](#api.clear.config),
[`getTemplateVars()`](#api.get.template.vars), [`assign()`](#api.assign)
and [`append()`](#api.append)
See also [`clearAllAssign()`](../../programmers/api-functions/api-clear-all-assign.md),
[`clearConfig()`](../../programmers/api-functions/api-clear-config.md),
[`getTemplateVars()`](../../programmers/api-functions/api-get-template-vars.md),
[`assign()`](../../programmers/api-functions/api-assign.md)
and [`append()`](../../programmers/api-functions/api-append.md)
8 changes: 4 additions & 4 deletions docs/programmers/api-functions/api-clear-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ expire\_time
template, you can clear a specific cache by supplying the `cache_id`
as the second parameter.

- You can also pass a [`$compile_id`](#variable.compile.id) as a third
- You can also pass a [`$compile_id`](../api-variables/variable-compile-id.md) as a third
parameter. You can [group templates together](#caching.groups) so
they can be removed as a group, see the [caching section](#caching)
they can be removed as a group, see the [caching section](../../api/caching/basics.md)
for more information.

- As an optional fourth parameter, you can supply a minimum age in
Expand All @@ -56,5 +56,5 @@ expire\_time



See also [`clearAllCache()`](#api.clear.all.cache) and
[`caching`](#caching) section.
See also [`clearAllCache()`](../../programmers/api-functions/api-clear-all-cache.md) and
[`caching`](../../api/caching/basics.md) section.
6 changes: 3 additions & 3 deletions docs/programmers/api-functions/api-clear-compiled-tpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ exp\_time

This clears the compiled version of the specified template resource, or
all compiled template files if one is not specified. If you pass a
[`$compile_id`](#variable.compile.id) only the compiled template for
this specific [`$compile_id`](#variable.compile.id) is cleared. If you
[`$compile_id`](../api-variables/variable-compile-id.md) only the compiled template for
this specific [`$compile_id`](../api-variables/variable-compile-id.md) is cleared. If you
pass an exp\_time, then only compiled templates older than `exp_time`
seconds are cleared, by default all compiled templates are cleared
regardless of their age. This function is for advanced use only, not
Expand All @@ -41,4 +41,4 @@ normally needed.



See also [`clearCache()`](#api.clear.cache).
See also [`clearCache()`](../../programmers/api-functions/api-clear-cache.md).
14 changes: 7 additions & 7 deletions docs/programmers/api-functions/api-clear-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ string

var

This clears all assigned [config variables](#language.config.variables).
This clears all assigned [config variables](../../designers/language-variables/language-config-variables.md).
If a variable name is supplied, only that variable is cleared.


Expand All @@ -27,9 +27,9 @@ If a variable name is supplied, only that variable is cleared.



See also [`getConfigVars()`](#api.get.config.vars),
[`config variables`](#language.config.variables),
[`config files`](#config.files),
[`{config_load}`](#language.function.config.load),
[`configLoad()`](#api.config.load) and
[`clearAssign()`](#api.clear.assign).
See also [`getConfigVars()`](../../programmers/api-functions/api-get-config-vars.md),
[`config variables`](../../designers/language-variables/language-config-variables.md),
[`config files`](../../designers/config-files.md),
[`{config_load}`](../../designers/language-builtin-functions/language-function-config-load.md),
[`configLoad()`](../../programmers/api-functions/api-config-load.md) and
[`clearAssign()`](../../programmers/api-functions/api-clear-assign.md).
18 changes: 9 additions & 9 deletions docs/programmers/api-functions/api-config-load.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ string

section

This loads [config file](#config.files) data and assigns it to the
This loads [config file](../../designers/config-files.md) data and assigns it to the
template. This works identically to the template
[`{config_load}`](#language.function.config.load) function.
[`{config_load}`](../../designers/language-builtin-functions/language-function-config-load.md) function.

> **Note**
>
> As of Smarty 2.4.0, assigned template variables are kept across
> invocations of [`fetch()`](#api.fetch) and
> [`display()`](#api.display). Config vars loaded from `configLoad()`
> invocations of [`fetch()`](../../programmers/api-functions/api-fetch.md) and
> [`display()`](../../programmers/api-functions/api-display.md). Config vars loaded from `configLoad()`
> are always global in scope. Config files are also compiled for faster
> execution, and respect the [`$force_compile`](#variable.force.compile)
> execution, and respect the [`$force_compile`](../api-variables/variable-force-compile.md)
> and [`$compile_check`](#variable.compile.check) settings.


Expand All @@ -41,7 +41,7 @@ template. This works identically to the template



See also [`{config_load}`](#language.function.config.load),
[`getConfigVars()`](#api.get.config.vars),
[`clearConfig()`](#api.clear.config), and
[`config variables`](#language.config.variables)
See also [`{config_load}`](../../designers/language-builtin-functions/language-function-config-load.md),
[`getConfigVars()`](../../programmers/api-functions/api-get-config-vars.md),
[`clearConfig()`](../../programmers/api-functions/api-clear-config.md) and
[`config variables`](../../designers/language-variables/language-config-variables.md)
2 changes: 1 addition & 1 deletion docs/programmers/api-functions/api-create-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ be used to control which variables are seen by which templates.


See also [`display()`](#api.display), and
See also [`display()`](../../programmers/api-functions/api-display.md), and
[`createTemplate()`](#api.create.template),
6 changes: 3 additions & 3 deletions docs/programmers/api-functions/api-create-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ array
data

This creates a template object which later can be rendered by the
[display](#api.display) or [fetch](#api.fetch) method. It uses the
[display](../../programmers/api-functions/api-display.md) or [fetch](../../programmers/api-functions/api-fetch.md) method. It uses the
following parameters:

- `template` must be a valid [template resource](#resources) type and
- `template` must be a valid [template resource](../../api/resources.md) type and
path.

<!-- -->
Expand All @@ -95,5 +95,5 @@ following parameters:



See also [`display()`](#api.display), and
See also [`display()`](../../programmers/api-functions/api-display.md), and
[`templateExists()`](#api.template.exists).
2 changes: 1 addition & 1 deletion docs/programmers/api-functions/api-disable-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ disableSecurity

This disables security checking on templates.

See also [`enableSecurity()`](#api.enable.security), and
See also [`enableSecurity()`](../../programmers/api-functions/api-enable-security.md), and
[Security](#advanced.features.security).
10 changes: 5 additions & 5 deletions docs/programmers/api-functions/api-display.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ string
compile\_id

This displays the contents of a template. To return the contents of a
template into a variable, use [`fetch()`](#api.fetch). Supply a valid
[template resource](#resources) type and path. As an optional second
template into a variable, use [`fetch()`](../../programmers/api-functions/api-fetch.md). Supply a valid
[template resource](../../api/resources.md) type and path. As an optional second
parameter, you can pass a `$cache_id`, see the [caching
section](#caching) for more information.
section](../../api/caching/basics.md) for more information.

PARAMETER.COMPILEID

Expand Down Expand Up @@ -60,7 +60,7 @@ PARAMETER.COMPILEID



Use the syntax for [template resources](#resources) to display files
Use the syntax for [template resources](../../api/resources.md) to display files
outside of the [`$template_dir`](#variable.template.dir) directory.


Expand All @@ -80,5 +80,5 @@ outside of the [`$template_dir`](#variable.template.dir) directory.



See also [`fetch()`](#api.fetch) and
See also [`fetch()`](../../programmers/api-functions/api-fetch.md) and
[`templateExists()`](#api.template.exists).
2 changes: 1 addition & 1 deletion docs/programmers/api-functions/api-enable-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ parameters:
For the details how to setup a security policy see the
[Security](#advanced.features.security) section.

See also [`disableSecurity()`](#api.disable.security), and
See also [`disableSecurity()`](../../programmers/api-functions/api-disable-security.md), and
[Security](#advanced.features.security).
29 changes: 14 additions & 15 deletions docs/programmers/api-functions/api-fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ string

compile\_id

This returns the template output instead of [displaying](#api.display)
it. Supply a valid [template resource](#resources) type and path. As an
optional second parameter, you can pass a `$cache id`, see the [caching
section](#caching) for more information.
This returns the template output instead of [displaying](../../programmers/api-functions/api-display.md)
it. Supply a valid [template resource](../../api/resources.md) type and path. As an
optional second parameter, you can pass a `$cache id`, see the
[caching section](../../api/caching/basics.md) for more information.

PARAMETER.COMPILEID

Expand Down Expand Up @@ -72,20 +72,19 @@ The `email_body.tpl` template
The php script using the PHP [`mail()`](https://www.php.net/function.mail)
function

```php
<?php

<?php

// get $contact_info from db or other resource here
// get $contact_info from db or other resource here

$smarty->assign('contact_info',$contact_info);
$smarty->assign('login_url',"http://{$_SERVER['SERVER_NAME']}/login");
$smarty->assign('contact_info',$contact_info);
$smarty->assign('login_url',"http://{$_SERVER['SERVER_NAME']}/login");

mail($contact_info['email'], 'Thank You', $smarty->fetch('email_body.tpl'));
mail($contact_info['email'], 'Thank You', $smarty->fetch('email_body.tpl'));

?>


?>
```

See also [`{fetch}`](#language.function.fetch)
[`display()`](#api.display), [`{eval}`](#language.function.eval), and
See also [`{fetch}`](../../designers/language-custom-functions/language-function-fetch.md)
[`display()`](api-display.md), [`{eval}`](../../designers/language-custom-functions/language-function-eval.md), and
[`templateExists()`](#api.template.exists).
12 changes: 6 additions & 6 deletions docs/programmers/api-functions/api-get-config-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ string

varname

If no parameter is given, an array of all loaded [config
variables](#language.config.variables) is returned.
If no parameter is given, an array of all loaded
[config variables](../../designers/language-variables/language-config-variables.md) is returned.


<?php
Expand All @@ -31,7 +31,7 @@ variables](#language.config.variables) is returned.



See also [`clearConfig()`](#api.clear.config),
[`{config_load}`](#language.function.config.load),
[`configLoad()`](#api.config.load) and
[`getTemplateVars()`](#api.get.template.vars).
See also [`clearConfig()`](../../programmers/api-functions/api-clear-config.md),
[`{config_load}`](../../designers/language-builtin-functions/language-function-config-load.md),
[`configLoad()`](../../programmers/api-functions/api-config-load.md) and
[`getTemplateVars()`](../../programmers/api-functions/api-get-template-vars.md).
4 changes: 2 additions & 2 deletions docs/programmers/api-functions/api-get-plugins-dir.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ getPluginsDir



See also [`setPluginsDir()`](#api.set.plugins.dir),
[`addPluginsDir()`](#api.add.plugins.dir) and
See also [`setPluginsDir()`](../../programmers/api-functions/api-set-plugins-dir.md),
[`addPluginsDir()`](../../programmers/api-functions/api-add-plugins-dir.md) and
[`$plugins_dir`](#variable.plugins.dir).
Loading