Closed SDKiller closed 9 years ago
\yii\widgets\InputWidget::hasModel checks if $model instanceof \yii\base\Model
\yii\widgets\InputWidget::hasModel
$model
\yii\base\Model
But \yii\base\Model have no methods getPrimaryKey() and getIsNewRecord() - they are implemented in ActiveRecord
getPrimaryKey()
getIsNewRecord()
ActiveRecord
Althow this widget is mostly supposed to work with ActiveRecord, I think better avoid throwing errors in other Model cases.
Model
Agree @SDKiller thanks
\yii\widgets\InputWidget::hasModel
checks if$model
instanceof\yii\base\Model
But
\yii\base\Model
have no methodsgetPrimaryKey()
andgetIsNewRecord()
- they are implemented inActiveRecord
Althow this widget is mostly supposed to work with
ActiveRecord
, I think better avoid throwing errors in otherModel
cases.