SHARE
TWEET

Untitled

a guest Jul 17th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Top