How to save multiple records for single attribute

Hello Everyone,

I am new to Yii framework. I am using riak database.

I want to store multiple addresses(address,city,state,zip) for single user.

Rightnow my code is working for single address i.e single city,single state, single zip but when i try to save multiple addresses then it causes problem.

my code is :

protected function save(\CModel $model) {

if (empty($this->modelName))

$this->modelName = $this->modelClass;

if (isset($_POST[$this->modelName])) {

$model->attributes = $_POST[$this->modelName];

$modelsaved = $model->save();

}

}

Please help me out.

Thanks in advance.

Create a model for Addresses and use Tabular input.