nenad-zivkovic / yii2-advanced-template

Yii2 improved advanced application template that can bake you cookies
BSD 3-Clause "New" or "Revised" License
93 stars 66 forks source link

column name 'Item Name' in user/update #12

Closed tamer-hassan closed 9 years ago

tamer-hassan commented 9 years ago

in user/update, the "item_name" column (reads 'Item Name') is not translated to "Role" as on user/view page.

I see in models/User.php there's a method attributeLabels() that translate 'item_name' to 'Role'

Why is user/view using it but not user/update page?

nenad-zivkovic commented 9 years ago

http://prntscr.com/6ge1w9

It says Role. I don't understand your question ?

tamer-hassan commented 9 years ago

logged in as superadmin (theCreator), updating another user (editor). It says "Item Name" ? http://prntscr.com/6gfh89

tamer-hassan commented 9 years ago

Adding the following to common/rbac/models/Role.php resolves the issue for the Create & Update forms. (displays "Role" instead of "item_name").

    /**
     * Returns the attribute labels.
     *
     * @return array
     */
    public function attributeLabels()
    {
        return [
            'item_name' => Yii::t('app', 'Role'),
        ];
    }
nenad-zivkovic commented 9 years ago

Thank you. Sorry for no response, I was very busy, but I will add this fix in the next release.