TbHtml::switchOffsetCol PHP Method

switchOffsetCol() protected static method

Switches the column class to and from the col width itself to its offset counterpart. For example, passing in col-md-2 would be switched to col-md-offset-2
protected static switchOffsetCol ( string $class ) : string
$class string
return string
    protected static function switchOffsetCol($class)
    {
        // todo: why would you want to do this
        if (strpos($class, 'offset') !== false) {
            return str_replace('-offset', '', $class);
        } else {
            preg_match('/^(col-.*-)([0-9]*)$/', $class, $matches);
            return $matches[1] . 'offset-' . $matches[2];
        }
    }
TbHtml