Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how about change the usernameField expression as a Column expression #479

Open
liyadongcn opened this issue Jun 15, 2023 · 1 comment
Open

Comments

@liyadongcn
Copy link

change the expression like this :
....
'usernameField' => ['attribute' => 'username','label' => 'User Name'],
....

it will easy to change the user name label just like the extraColumns.

i used the theme to change the view of assigment. You have to change the code like this in the view.
...
if (is_array($usernameField)){
// usernameField is an array
$userName = $model->{$usernameField['attribute']};
}else{
// usernameField is a string
$userName = $model->{$usernameField};
}
....

@liyadongcn
Copy link
Author

liyadongcn commented Jun 26, 2023

idea changed. change the 'extraColumns' parameter to 'columns' means you can show the field you want to. 'usernameFiled' can be showed or not if you put this field in the 'columns'. now the usernameField is showed in the simplest way , even you can not change the showing name on the table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant