Chtml::listdata With Function Instead Of Attribute Not Working

Hey,

I’m using Yii 1.1.13 and PHP 5.2.12 unfortunatley i cannot upgrade to php 5.3 at the Moment.

I need the listdata in a kind of:


CHtml::listData(User::model()->findAll($criteria),"id","functionxyz('01.01.2013')","functionTwo('attribute')");

Is there a way to achieve this without PHP 5.3?

The first Function needs a date to be compared and the second one just an ID.

I can’t use the Criteria for this, because my function returns additional Information for the User Depending on another Table. It count’s the Entries for a given Month.

Somebody got an Idea?

Thanks!

Instead of using CHtml::listData(), it might be easier to create a static method in the model to return the data in the required format.




    public static function getSelectOptions()

    {

        // build and return array here

    }



Baah, stupid me, sure! Thank you!