helpers\BaseHtml getInputName()

getInputName() public static method

Generates an appropriate input name for the specified attribute name or expression.

This method generates a name that can be used as the input name to collect user input for the specified attribute. The name is generated according to the form name of the model and the given attribute name. For example, if the form name of the Post model is Post, then the input name generated for the content attribute would be Post[content].

See getAttributeName() for explanation of attribute expression.

public static string getInputName ( $model, $attribute )
$model yii\base\Model

The model object

$attribute string

The attribute name or expression

return string

The generated input name

throws yii\base\InvalidParamException

if the attribute name contains non-word characters.

doc_Yii
2016-10-30 17:05:08
Comments
Leave a Comment

Please login to continue.