CakePHP: lists, beautiful bits

These tiny bits of beauty really make the development enjoyable:

$names = $this->find(‘list’, array(
‘conditions’=> null,
‘order’       => ‘Developer.id ASC’,
‘fields’       => array(‘Developer.id’,‘Developer.’.$name.),
‘recursive’ => 0
));

as the result, getting:

Array = (
[1] => ‘Pafilia’,
[2] => ‘Vashiotis’
);

I’ll miss these features if I move from this framework :)

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.