Chris PeBenito 696b41
Chris PeBenito 696b41
/**
Chris PeBenito 696b41
 * Smarty plugin
Chris PeBenito 696b41
 * @package Smarty
Chris PeBenito 696b41
 * @subpackage plugins
Chris PeBenito 696b41
 */
Chris PeBenito 696b41
Chris PeBenito 696b41
Chris PeBenito 696b41
/**
Chris PeBenito 696b41
 * Smarty default modifier plugin
Chris PeBenito 696b41
 *
Chris PeBenito 696b41
 * Type:     modifier
Chris PeBenito 696b41
 * Name:     default
Chris PeBenito 696b41
 * Purpose:  designate default value for empty variables
Chris PeBenito 696b41
 * @link http://smarty.php.net/manual/en/language.modifier.default.php
Chris PeBenito 696b41
 *          default (Smarty online manual)
Chris PeBenito 696b41
 * @param string
Chris PeBenito 696b41
 * @param string
Chris PeBenito 696b41
 * @return string
Chris PeBenito 696b41
 */
Chris PeBenito 696b41
function smarty_modifier_default($string, $default = '')
Chris PeBenito 696b41
{
Chris PeBenito 696b41
    if (!isset($string) || $string === '')
Chris PeBenito 696b41
        return $default;
Chris PeBenito 696b41
    else
Chris PeBenito 696b41
        return $string;
Chris PeBenito 696b41
}
Chris PeBenito 696b41
Chris PeBenito 696b41
/* vim: set expandtab: */
Chris PeBenito 696b41
Chris PeBenito 696b41
?>