# 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](/developers/templates/schema.md).&#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.
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tebex.io/developers/templates/twig/functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
