Exemplo n.º 1
0
function prettyText($str, $typography = true)
{
    static $endPunct = array('.', ',', '!', '?');
    $str = $typography ? typography($str) : S::capitalize(trim($str));
    if ($str === '') {
        return $str;
    }
    in_array(S::last($str), $endPunct) or $str .= '.';
    return $str;
}
Exemplo n.º 2
0
 static function prettyOther(array $attrs)
 {
     foreach ($attrs as $name => &$value) {
         switch ($name) {
             case 'title':
             case 'maker':
                 $value = typography($value);
                 break;
             case 'country':
                 $value = S::capitalize(trim($value));
                 break;
             case 'desc':
                 $value = prettyText($value);
                 break;
         }
     }
     return $attrs;
 }