1 |
1546
|
Luisehahne
|
<?php
|
2 |
|
|
/**
|
3 |
|
|
* QuickSkin Extension nvl
|
4 |
|
|
* Insert a default value if variable is empty
|
5 |
|
|
*
|
6 |
|
|
* Usage Example:
|
7 |
|
|
* Content: $template->assign('PREVIEW1', 'picture_21.gif');
|
8 |
|
|
* Template: <img src="{nvl:PREVIEW1,'not_available.gif'}"> / <img src="{nvl:PREVIEW2,'not_available.gif'}">
|
9 |
|
|
* Result: <img src="picture_21.gif"> / <img src="not_available.gif">
|
10 |
|
|
*
|
11 |
|
|
* @author Andy Prevost andy@codeworxtech.com - original by Philipp v. Criegern philipp@criegern.de
|
12 |
|
|
*/
|
13 |
|
|
function qx_nvl ( $param, $default ) {
|
14 |
|
|
if (strlen($param)) {
|
15 |
|
|
return ( $param );
|
16 |
|
|
} else {
|
17 |
|
|
return ( $default );
|
18 |
|
|
}
|
19 |
|
|
}
|