Keoma Borges
Keoma Borges

Reputation: 694

CakePHP: is there a way to make every find('list') return an array ordered?

I'd like every Model->find('list') could return the array ordered by the $displayField set on Model. Is there a way to do this beyond set 'order' => 'Model.display_field ASC' on every find call?

Upvotes: 1

Views: 71

Answers (1)

bill
bill

Reputation: 1656

Yes, just set $order in the model.

http://book.cakephp.org/2.0/en/models/model-attributes.html#order

Upvotes: 4

Related Questions