$this->renderPartial('_form', array(
'model' => array(
'model'=>$model,
'model2'=>$model2
),
'buttons' => 'create'
));
code above means that file _form.php
will have access to two variables:
$model - array of two elements, and $buttons - string.
So, to get access to first model you have to write $model['model']
, second - $model['model2']
.
but in this code
<?php echo $form->labelEx($model2,'aciklama'); ?>
<?php echo $form->textField($model2,'aciklama'); ?>
<?php echo $form->error($model2,'aciklama'); ?>
You are trying to access undefined variable $model2
. And this should raise respective error.
The thing that error is not got makes me thinking that somewhere before listed code you access variable $model
in the similar way, something like this:
echo $form->labelEx($model,'test');
In the above code $model
is array(because you passed array). That is why you receive error that object is expected.
So, you should either pass models or access them in a proper way.
I hope this helps.