Custom Functions

Smarty Manual
Prev |  | Next

# Chapter 8. Custom Functions

Smarty comes with several custom functions that you can use in the templates.

# assign

Attribute Name | Type | Required | Default | Description
--- | --- | --- | --- | ---
var | string | Yes | n/a | The name of the variable being assigned
value | string | Yes | n/a | The value being assigned

assign is used for assigning template variables during the execution of the template.

Example 8-1. assign
    {assign var="name" value="Bob"}

    The value of $name is {$name}.

    OUTPUT:

    The value of $name is Bob.

Prev | Home | Next
strip | Up | counter