Files
smarty/docs/designers/language-modifiers/language-modifier-cat.md

37 lines
640 B
Markdown
Raw Permalink Normal View History

2023-02-06 14:42:31 +01:00
# cat
This value is concatenated to the given variable.
2023-02-06 14:42:31 +01:00
## Basic usage
```smarty
{$myVar|cat:' units'}
```
2023-02-06 14:42:31 +01:00
## Parameters
2023-02-06 14:42:31 +01:00
| Parameter | Type | Required | Description |
|-----------|--------|----------|--------------------------------------------------|
| 1 | string | No | This value to concatenate to the given variable. |
2023-02-06 14:42:31 +01:00
## Examples
2023-02-06 14:42:31 +01:00
```php
<?php
2023-02-06 14:42:31 +01:00
$smarty->assign('articleTitle', "Psychics predict world didn't end");
2023-02-06 14:42:31 +01:00
```
2023-02-06 14:42:31 +01:00
Where template is:
2023-02-06 14:42:31 +01:00
```smarty
{$articleTitle|cat:' yesterday.'}
2023-02-06 14:42:31 +01:00
```
Will output:
2023-02-06 14:42:31 +01:00
```
Psychics predict world didn't end yesterday.
2023-02-06 14:42:31 +01:00
```