protected function formatName($column)
    {
        if (is_string($column)) {
            $name = explode('.', $column);

            if (1 === count($name)) {
                return $name[0];
            }

            $html = array_shift($name);
            foreach ($name as $piece) {
                $html .= "[$piece]";
            }

            return $html;
        }

        if (is_array($this->column)) {
            $names = [];
            foreach ($this->column as $key => $name) {
                $names[$key] = $this->formatName($name);
            }

            return $names;
        }

        return '';
    }
protected function formatName($column)
    {
        if (is_string($column)) {
            $name = explode('.', $column);

            if (1 === count($name)) {
                return $name[0];
            }

            $html = array_shift($name);
            foreach ($name as $piece) {
                $html .= "[$piece]";
            }

            return $html;
        }

        if (is_array($this->column)) {
            $names = [];
            foreach ($this->column as $key => $name) {
                $names[$key] = $this->formatName($name);
            }

            return $names;
        }

        return '';
    }
protected function formatName ( $ column ) { if ( is_string ( $ column ) ) { $ name = explode ( '.' , $ column ) ; if ( 1 === count ( $ name ) ) { return $ name [ 0 ] ; } $ html = array_shift ( $ name ) ; foreach ( $ name as $ piece ) { $ html .= "[$piece]" ; } return $ html ; } if ( is_array ( $ this -> column ) ) { $ names = [ ] ; foreach ( $ this -> column as $ key => $ name ) { $ names [ $ key ] = $ this -> formatName ( $ name ) ; } return $ names ; } return '' ; }
Format the name of the field.

@param string $column

@return array|mixed|string
Format the name of the field .