Gdn_Theme::text PHP Method

text() public static method

public static text ( $Code, $Default ) : mixed
$Code
$Default
return mixed
    public static function text($Code, $Default)
    {
        return c("ThemeOption.{$Code}", t('Theme_' . $Code, $Default));
    }

Usage Example

Example #1
0
/**
 * Returns the  custom text from a theme.
 *
 * @param array $Param The parameters passed into the function. This currently takes no parameters.
 *  - <b>code</b>: The text code set in the theme's information.
 *  - <b>default</b>: The default text if the user hasn't overridden.
 * @param Smarty The smarty object rendering the template.
 * @return The text.
 */
function smarty_function_text($Params, &$Smarty)
{
    $Result = Gdn_Theme::text(val('code', $Params, ''), val('default', $Params, ''));
    return $Result;
}