TbHtml::switchColToOffset PHP Method

switchColToOffset() protected static method

Nearly identical to {@link switchOffsetCol()} except it forces the class to be returned as its offset counterpart. It is also safe to pass in a class that is already an offset and it will just re-return it. For example, passing in col-md-2 will return col-md-offset-2. Passing in col-md-offset-4 will still return col-md-offset-4.
protected static switchColToOffset ( string $class ) : string
$class string
return string
    protected static function switchColToOffset($class)
    {
        // todo: why would you want to do this
        if (strpos($class, 'offset') === false && preg_match('/^(col-.*-)([0-9]*)$/', $class, $matches) > 0) {
            return $matches[1] . 'offset-' . $matches[2];
        } else {
            return $class;
        }
    }
TbHtml