{"record":{"id":"cb63f612e9da8961","repo":"yiisoft/yii2","slug":"the-column-must-be-specified-in-the-format-of-att","errorCode":null,"errorMessage":"The column must be specified in the format of \"attribute\", \"attribute:format\" or \"attribute:format:label\"","messagePattern":"The column must be specified in the format of \"attribute\", \"attribute:format\" or \"attribute:format:label\"","errorType":"exception","errorClass":"InvalidConfigException","httpStatus":null,"severity":"error","filePath":"framework/grid/GridView.php","lineNumber":587,"sourceCode":"            }\n            if (!$column->visible) {\n                unset($this->columns[$i]);\n                continue;\n            }\n            $this->columns[$i] = $column;\n        }\n    }\n\n    /**\n     * Creates a [[DataColumn]] object based on a string in the format of \"attribute:format:label\".\n     * @param string $text the column specification string\n     * @return DataColumn the column instance\n     * @throws InvalidConfigException if the column specification is invalid\n     */\n    protected function createDataColumn($text)\n    {\n        if (!preg_match('/^([^:]+)(:(\\w*))?(:(.*))?$/', $text, $matches)) {\n            throw new InvalidConfigException('The column must be specified in the format of \"attribute\", \"attribute:format\" or \"attribute:format:label\"');\n        }\n\n        return Yii::createObject([\n            'class' => $this->dataColumnClass ?: DataColumn::className(),\n            'grid' => $this,\n            'attribute' => $matches[1],\n            'format' => isset($matches[3]) ? $matches[3] : 'text',\n            'label' => isset($matches[5]) ? $matches[5] : null,\n        ]);\n    }\n\n    /**\n     * This function tries to guess the columns to show from the given data\n     * if [[columns]] are not explicitly specified.\n     */\n    protected function guessColumns()\n    {\n        $models = $this->dataProvider->getModels();","sourceCodeStart":569,"sourceCodeEnd":605,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/grid/GridView.php#L569-L605","documentation":"Error \"The column must be specified in the format of \"attribute\", \"attribute:format\" or \"attribute:format:label\"\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/grid/GridView.php:587 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}