I have following code in my model:
public function getData($property)
{
$data = array(
'a_4_1' => array(
'RUB',
'USD',
'JPY',
),
);
return $data[$property];
}
And in my view:
<?= $form->labelEx($model, 'a_4_1', array('class' => 'col-xs-12 col-sm-2 control-label')) ?>
<div class="col-xs-12 col-sm-3">
<?= $form->dropDownList($model, 'a_4_1',$model->getData('d_4_1'), array('class' => 'form-control')) ?>
<?= $form->error($model, 'a_4_1') ?>
</div>
When I save it to the database, it saves data in the integer format (e.g 1,2,..) I need to save array elements' names to the database(e.g RUB, USD)(not integer numbers). How can I do it?