Yii2: Chg: Remove prefix model name from name of active input.

Created on 30 Apr 2016  路  2Comments  路  Source: yiisoft/yii2

Whould you considering to remove prefix model name from name of active input. I mean, when we have model User and attribute name, then the generated input name is "[User]name". Whould you just generate "name" as input name. Since we have safe validator, IMO, its OK to have more than one model in one form without any conflicting.
Remove prefix name give more prety url in filtering (gridview), more compatible with several javascript plugin, more compatible with rest, etc...

Prefix name use to avoid attribute collision between to model in one form.

Well... Is any someone who have that case? Have to models with same attribute but provide different value?

docs

Most helpful comment

added a note to the guide

All 2 comments

you can set formName() of the model to empty string if you want this.

added a note to the guide

Was this page helpful?
0 / 5 - 0 ratings