mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-21 00:15:20 +02:00
22 lines
453 B
PHP
22 lines
453 B
PHP
<?php
|
|
|
|
/*
|
|
* Smarty plugin
|
|
* -------------------------------------------------------------
|
|
* Type: modifier
|
|
* Name: default
|
|
* Purpose: designate default value for empty variables
|
|
* -------------------------------------------------------------
|
|
*/
|
|
function smarty_modifier_default($string, $default = '')
|
|
{
|
|
if (!isset($string) || $string == '')
|
|
return $default;
|
|
else
|
|
return $string;
|
|
}
|
|
|
|
/* vim: set expandtab: */
|
|
|
|
?>
|