BootstrapUI\View\Helper\FormHelper::_gridClass PHP Method

_gridClass() protected method

Returns a Bootstrap grid class (i.e. col-md-2).
protected _gridClass ( string $position, boolean $offset = false ) : string
$position string One of `left`, `middle` or `right`.
$offset boolean If true, will append `offset-` to the class.
return string Classes.
    protected function _gridClass($position, $offset = false)
    {
        $class = 'col-%s-';
        if ($offset) {
            $class .= 'offset-';
        }
        if (isset($this->_grid[$position])) {
            return sprintf($class, 'md') . $this->_grid[$position];
        }
        $classes = [];
        foreach ($this->_grid as $screen => $positions) {
            if (isset($positions[$position])) {
                array_push($classes, sprintf($class, $screen) . $positions[$position]);
            }
        }
        return implode(' ', $classes);
    }