Arrayhelper With Function

I have model with follow data:

ID DATE(timestamp)

1 12312342

2 21321312

I need view it in dropList, but before process (convert dates in clear view):


<select name="foobar">

<option value="1">1 June 2014</option>

<option value="2">2 June 2014</option>

</select>



I use


 echo Html::dropDownList(

            'parse_id',

            NULL,

            ArrayHelper::map(Parser::find()->all(), 'id', 'date'))  ?>



But I have


<select name="foobar">

<option value="1">123231232</option>

<option value="2">123123123</option>

</select>



How can I do it?

Thanks,

Denis.

You may use the same approach as described for Yii 1.1

Example:

Parser model:


public function getFormattedDate(){

   return date('Y-m-d', $this->date);

}



Calling dropDownList(), replace ‘date’ with a ‘formattedDate’ .

Thanks. It works for me.