public static function formatKey($key, $options = null)
    {
        $options = Helper::getOptions($options, [
            "underscores"   =>  true,
            "ucwords"       =>  true,
        ]);

        if ($options["underscores"]) {
            $val = str_replace("_", "&nbsp;", $key);
        }

        if ($options["ucwords"]) {
            $val = ucwords($val);
        }

        return $val;
    }
public static function formatKey($key, $options = null)
    {
        $options = Helper::getOptions($options, [
            "underscores"   =>  true,
            "ucwords"       =>  true,
        ]);

        if ($options["underscores"]) {
            $val = str_replace("_", "&nbsp;", $key);
        }

        if ($options["ucwords"]) {
            $val = ucwords($val);
        }

        return $val;
    }
public static function formatKey ( $ key , $ options = null ) { $ options = Helper :: getOptions ( $ options , [ "underscores" => true , "ucwords" => true , ] ) ; if ( $ options [ "underscores" ] ) { $ val = str_replace ( "_" , "&nbsp;" , $ key ) ; } if ( $ options [ "ucwords" ] ) { $ val = ucwords ( $ val ) ; } return $ val ; }
Format a string in a human readable way.
Typically used for converting "safe" strings like "section_title" to user displayable strings like "Section Title"

$options:
- string "underscores" Convert underscores to spaces (default: true)
- string "ucwords" Run the string through ucwords (default: true)

@param string $key The string to format
@param array $options An array of options (see above)

@return string
Format a string in a human readable way . Typically used for converting safe strings like section_title to user displayable strings like Section Title