Encore\Admin\Form\Field::formatName PHP Method

formatName() protected method

Format the name of the field.
protected formatName ( string $column ) : array | mixed | string
$column string
return array | mixed | string
    protected function formatName($column)
    {
        if (is_string($column)) {
            $name = explode('.', $column);
            if (count($name) == 1) {
                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 '';
    }