Добрый день! Подскажите, что за ошибка Call to a member function isAttributeRequired() on array?
View
$form = ActiveForm::begin();
echo $form->field($modelPagesOnList, 'state_22')->dropDownList([
'0' => 'Активный',
'1' => 'Отключен',
'2'=>'Удален'
]);
ActiveForm::end();
Модель
class PagesOnList extends Model
{
public $state_22;
public function rules()
{
return [
[['state_22'], 'required'],
];
}
public function attributeLabels()
{
return array(
'state_22'=>$this->state_22
);
}
}
Контроллер
$modelPagesOnList = new PagesOnList();
$modelPagesOnList->attributes = Yii::$app->request->post('PagesOnList');
print_r($modelPagesOnList->state_22);
....
return $this->render('index', ['modelPagesOnList'=>$modelPagesOnList]);