Field's value disappears after submit

It shouldn’t be a big thing at all but I really can’t get around it.

I’ve created a CRUD by Gii and I didn’t touch the generated code. The problem is my $model->attributes disappears somewhere and I just can’t figure out where!

The controller action :

public function actionCreate()


		$model=new AttributeType;

		// Uncomment the following line if AJAX validation is needed

		// $this->performAjaxValidation($model);












The model rule :

public function rules()


		// NOTE: you should only define rules for those attributes that

		// will receive user inputs.

		return array(

			array('Title', 'required'),

			array('Title', 'length', 'max'=>100),

			// The following rule is used by search().

			// Please remove those attributes that should not be searched.

			array('ID, Title', 'safe', 'on'=>'search'),



As you can see in figure below, result of


indicates that controller receives the value but I dunno what happens after save() that the value becomes empty. Am I missing something?

Have you checked the yii/requirements/ on your web server, I suspect there is something missing.

I don’t think so since the same server configuration is hosting two other Yii applications.

For the records, the problem was that I had a relationship defined with name "attributes" which was causing the problem.

'attribtues' => array(self::HAS_MANY, 'Attribute', 'AttributeType_ID')

changing name of the relationship solved it.