# Functions

Functions generate content for you to use within your templates.

If you'd like access to a TWIG function that is not available below, [please let us know.](https://forms.monday.com/forms/8cbacdac7c30b725cd4617cbba0e5eeb?r=use1)

### Available Functions

| Function | Documentation                                                 |
| -------- | ------------------------------------------------------------- |
| `__`     | [View](#__)                                                   |
| `_p`     | [View](#_p)                                                   |
| `config` | [View](#config)                                               |
| `asset`  | [View](#asset)                                                |
| `path`   | [View](#path)                                                 |
| `query`  | [View](#query)                                                |
| `range`  | [View](https://twig.symfony.com/doc/1.x/functions/range.html) |

### Function Documentation

### `__`

Returns the equivalent translation from within your translations settings.

```twig
{{ __('Redeem coupons / gift cards') }}

// prints "Redeems coupons / gift cards" (Or the equivalent translation if another language is selected)
```

### `_p`

Returns the plural translation from within your translation settings.

```twig
{{ _p(":count items for :amount :currency", basket.packages|length, {'count' : basket.packages|length, 'amount' : basket.price|money, 'currency' : basket.currency}) }}

// prints "5 items for $5.00 USD"
```

### `config`

Returns a config value from your [template config schema](https://docs.tebex.io/developers/templates/schema).&#x20;

```twig
{{ config("header-colour") }}

// prints the associated config value with the key header-colour
```

### `asset`

Returns the full url path of an asset from within your template.

```twig
{{ asset("style.css") }}

// Prints the URL of style.css, such as https://your-store.tebex.io/template-assets/style.css"
```

### `path`

Returns the full url path of the current page.

```twig
{{ path() }}

// Prints the full URL of the current page the customer is browsing on your store
```

### `query`

Returns a GET parameter from the current url.

```twig
{{ query("test" }}

// Returns the GET param of "test" if it is provided in the URL.
```
