{"action":"reopened","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/16624","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/16624/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/16624/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/16624/events","html_url":"https://github.com/yiisoft/yii2/issues/16624","id":349382533,"node_id":"MDU6SXNzdWUzNDkzODI1MzM=","number":16624,"title":"GridView columns shortcut declarations: allow value function as value ","user":{"login":"robsch","id":2900992,"node_id":"MDQ6VXNlcjI5MDA5OTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2900992?v=4","gravatar_id":"","url":"https://api.github.com/users/robsch","html_url":"https://github.com/robsch","followers_url":"https://api.github.com/users/robsch/followers","following_url":"https://api.github.com/users/robsch/following{/other_user}","gists_url":"https://api.github.com/users/robsch/gists{/gist_id}","starred_url":"https://api.github.com/users/robsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robsch/subscriptions","organizations_url":"https://api.github.com/users/robsch/orgs","repos_url":"https://api.github.com/users/robsch/repos","events_url":"https://api.github.com/users/robsch/events{/privacy}","received_events_url":"https://api.github.com/users/robsch/received_events","type":"User","site_admin":false},"labels":[{"id":33332028,"node_id":"MDU6TGFiZWwzMzMzMjAyOA==","url":"https://api.github.com/repos/yiisoft/yii2/labels/type:enhancement","name":"type:enhancement","color":"d7e102","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2/milestones/22","html_url":"https://github.com/yiisoft/yii2/milestone/22","labels_url":"https://api.github.com/repos/yiisoft/yii2/milestones/22/labels","id":1962396,"node_id":"MDk6TWlsZXN0b25lMTk2MjM5Ng==","number":22,"title":"3.0.0","description":"","creator":{"login":"samdark","id":47294,"node_id":"MDQ6VXNlcjQ3Mjk0","avatar_url":"https://avatars2.githubusercontent.com/u/47294?v=4","gravatar_id":"","url":"https://api.github.com/users/samdark","html_url":"https://github.com/samdark","followers_url":"https://api.github.com/users/samdark/followers","following_url":"https://api.github.com/users/samdark/following{/other_user}","gists_url":"https://api.github.com/users/samdark/gists{/gist_id}","starred_url":"https://api.github.com/users/samdark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdark/subscriptions","organizations_url":"https://api.github.com/users/samdark/orgs","repos_url":"https://api.github.com/users/samdark/repos","events_url":"https://api.github.com/users/samdark/events{/privacy}","received_events_url":"https://api.github.com/users/samdark/received_events","type":"User","site_admin":false},"open_issues":244,"closed_issues":175,"state":"open","created_at":"2016-08-25T07:42:19Z","updated_at":"2018-10-26T09:57:27Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2018-08-10T05:39:12Z","updated_at":"2018-10-26T09:57:26Z","closed_at":null,"author_association":"NONE","body":"It would be nice if the columns could be defined this way:\r\n\r\n```php\r\n<?= GridView::widget([\r\n    'dataProvider' => $dataProvider,\r\n    'filterModel'  => $searchModel,\r\n    'columns'      => [\r\n        // ---- current style ----\r\n        [\r\n            'attribute' => 'full_name',\r\n            'label'     => 'Name',\r\n            'format'    => 'html',\r\n            'value'     => function (Order $model) {\r\n                return Html::tag('span', $model->first_name . '<br>' . $model->last_name);\r\n            },\r\n        ],\r\n        // ---- new alternative style ----\r\n        'full_name:html:Name' => function(Order $model) {\r\n            return Html::tag('span', $model->first_name . '<br>' . $model->last_name);\r\n        },\r\n        ...\r\n        ['class' => 'yii\\grid\\ActionColumn'],\r\n    ],\r\n]); ?>\r\n```\r\nWould that be possible? Because of formatting I need to declare columns explicitly quite often. This would reduce the lines of code a bit. "}}
{"actor":{"display_login":"samdark"}}