# {call} `{call}` is used to call a template function defined by the [`{function}`](./language-function-function.md) tag just like a plugin function. > **Note** > > Template functions are defined global. Since the Smarty compiler is a > single-pass compiler, The `{call}` 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. - The `{call}` tag must have the `name` attribute which contains the name of the template function. - Values for variables can be passed to the template function as [attributes](../language-basic-syntax/language-syntax-attributes.md). ## Attributes | Attribute Name | Required | Description | |----------------|----------|------------------------------------------------------------------------------------------| | name | Yes | The name of the template function | | assign | No | The name of the variable that the output of called template function will be assigned to | | [var ...] | No | variable to pass local to template function | ## Option Flags | Name | Description | |---------|--------------------------------------------| | nocache | Call the template function in nocache mode | ## Examples ```smarty {* define the function *} {function name=menu level=0}