public function toSplit($name, $splitor = '-', $to = self::LOWER) {
        switch ($to) {
            case self::UPPER:
                return strtoupper(preg_replace("/(.)([A-Z])/", "$1{$splitor}$2", $name));
            default:
                return strtolower(preg_replace("/(.)([A-Z])/", "$1{$splitor}$2", $name));
        }
    }
public function toSplit($name, $splitor = '-', $to = self::LOWER) {
        switch ($to) {
            case self::UPPER:
                return strtoupper(preg_replace("/(.)([A-Z])/", "$1{$splitor}$2", $name));
            default:
                return strtolower(preg_replace("/(.)([A-Z])/", "$1{$splitor}$2", $name));
        }
    }
public function toSplit ( $ name , $ splitor = '-' , $ to = self :: LOWER ) { switch ( $ to ) { case self :: UPPER : return strtoupper ( preg_replace ( "/(.)([A-Z])/" , "$1{$splitor}$2" , $ name ) ) ; default : return strtolower ( preg_replace ( "/(.)([A-Z])/" , "$1{$splitor}$2" , $ name ) ) ; } }
usage example. CmsPageSort => cms-page-sort
@param type $name
@param type $splitor
@param type $to
@return type
usage example . CmsPageSort = > cms - page - sort