Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. /*
  2.  * Usage {coalesce ...=... assign='...'}
  3.  * Returns the first value of all parameters (except 'assign') that is not empty.
  4.  * If 'assign' specified, sets Smarty variable. Otherwise prints.
  5.  */
  6.  
  7. foreach ($params as $name => $value) {
  8.     if ($name != 'assign' && !empty($value)) {
  9.         if ($params['assign']) {
  10.             cmsms()->GetSmarty()->assign($params['assign'], $value);
  11.         } else {
  12.             echo $value;
  13.         }
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement