getAttributeValue() public static method
Returns the value of the specified attribute name or expression.
For an attribute expression like [0]dates[0]
, this method will return the value of $model->dates[0]
. See getAttributeName() for more details about attribute expression.
If an attribute value is an instance of yii\db\ActiveRecordInterface or an array of such instances, the primary value(s) of the AR instance(s) will be returned instead.
public static string|array getAttributeValue ( $model, $attribute ) | ||
---|---|---|
$model | yii\base\Model |
The model object |
$attribute | string |
The attribute name or expression |
return | string|array |
The corresponding attribute value |
throws | yii\base\InvalidParamException |
if the attribute name contains non-word characters. |
Please login to continue.