CakePhp 2.0 sort on associated model using Pagination / Paginator
问题 I realize this question is literally all over StackOverflow, but none of the answers seem to work for me. My problem is dirt-simple. I just want to list Companies ordered by City name: class Company extends AppModel public $recursive = 2; public $belongsTo = array( 'City' => array( 'className' => 'City', 'foreignKey' => 'city_id' ) ); class City extends AppModel { public $useTable = 'cities'; public $belongsTo = 'Country'; public $hasMany = array( 'Company' => array( 'className' => 'Company',