Noherczeg\Breadcrumb\Builders\Builder::casing PHP Метод

casing() публичный Метод

casing: Provides casing operation to the class.
public casing ( String $string, String $to = '' ) : String
$string String String to format
$to String Name of casing
Результат String
    public function casing($string, $to = '')
    {
        $res = null;
        // Pick one! :)
        switch ($to) {
            case 'lower':
                $res = mb_strtolower($string);
                break;
            case 'upper':
                $res = mb_strtoupper($string);
                break;
            case 'title':
                $res = ucfirst(strtolower($string));
                break;
            default:
                $res = $string;
                break;
        }
        return $res;
    }