base\Model formName()

formName() public method

Returns the form name that this model class should use.

The form name is mainly used by yii\widgets\ActiveForm to determine how to name the input fields for the attributes in a model. If the form name is "A" and an attribute name is "b", then the corresponding input name would be "A[b]". If the form name is an empty string, then the input name would be "b".

The purpose of the above naming schema is that for forms which contain multiple different models, the attributes of each model are grouped in sub-arrays of the POST-data and it is easier to differentiate between them.

By default, this method returns the model class name (without the namespace part) as the form name. You may override it when the model is used in different forms.

See also load().

public string formName ( )
return string

The form name of this model class.

doc_Yii
2016-10-30 16:51:48
Comments
Leave a Comment

Please login to continue.