mjaut
mjaut

Reputation: 11

The attribute must be specified in the format of "Name:Type:Label", where "Type" and "Label" are optional

I have two models/mysql tables: User and Truck. In my Truck table I have row user_id and in my Truck _form.php I created dropDownList field user_id which is populating from User table. Code:

<?php echo $form->dropDownList($model,'user_id', CHtml::listData(User::model()->findAll(), 'id', 'name')); ?>

And it works fine, I manage to list all Users in my dropdown. But when I save form data it should redirect me to CDetailView but instead i get this error:

"The attribute must be specified in the format of "Name:Type:Label", where "Type" and "Label" are optional."

Could someone tell me what's causing this problem, I tried to set relations and everything but still get this error.. Thanks

Upvotes: 0

Views: 460

Answers (0)

Related Questions