H
H
hollanditkzn2017-03-13 18:50:32
Yii
hollanditkzn, 2017-03-13 18:50:32

How to change the column header to your own in crud, and not from the database?

I found the grid widget, tried to change it, but I still get errors. How can I change from the English that is indicated in the database to my own version? where to look and what approximately you need to write, as I understand it, no label, no name, nothing like that is suitable

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-03-14
@webinar

1. You can change the label in the model, moreover, gii forms the model with this method:

/**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'id',
            'email' => Yii::t('text', 'email'),
            'username' => Yii::t('text', 'username'),
.....

It can be made dependent on the scenario and display different titles for each scenario
2. if in the gridView, then as padlyuck
wrote 3. if in the form:
All this is in the office. guide and documentation, be sure to read it all before starting development:
www.yiiframework.com/doc-2.0/guide-README.html
www.yiiframework.com/doc-2.0/index.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question