modifier.append.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2020 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
11 
12 /**
13  * Append a value, if the string is not empty
14  *
15  * Example:
16  * @code
17  * {$text|append:", "}
18  * @endcode
19  *
20  * @param $string The string to append to
21  * @param $suffix The value to append
22  * @return String
23  */
24 function smarty_modifier_append($string, $suffix) {
25  return strlen($string) > 0 ? $string.$suffix : "";
26 }
27 ?>